如何在codeigniter的锚码内使用bootstrap确认框

时间:2015-01-31 10:16:55

标签: php twitter-bootstrap codeigniter

我不知道如何在CodeIgniter的锚码内嵌入bootstrap确认删除代码。

foreach($books as $row)
{
    //Add each result row into table
    $this->table->add_row(
        $row['fname'],
        $row['email'],
        $row['pass'],
        $row['image'],
        anchor('welcome/remove_rcrd/'.$row['id'], 'delete'),
        anchor('welcome/edit/'.$row['id'], 'Edit'));
}

当我点击删除锚点或链接

时,我想添加引导程序确认框

1 个答案:

答案 0 :(得分:0)

我认为这可能会对你有所帮助

<?php $onclick = array('onclick'=>"return confirm('Are you sure?')");?>
<?=anchor("welcome/delete/$row->id","Delete", $onclick);?>