Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/codeigniter/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Php Codeigniter发送GET参数与站点\u url?_Php_Codeigniter_Codeigniter 3 - Fatal编程技术网

Php Codeigniter发送GET参数与站点\u url?

Php Codeigniter发送GET参数与站点\u url?,php,codeigniter,codeigniter-3,Php,Codeigniter,Codeigniter 3,我的视图文件中有这部分代码: <?php foreach ($posts as $post) { ?> <tr> <td><?php echo $post['id']; ?></td> <td><?php echo $post['title']; ?></td> <td><?php echo $post['content'];

我的视图文件中有这部分代码:

<?php foreach ($posts as $post) { ?>
    <tr>
        <td><?php echo $post['id']; ?></td>
        <td><?php echo $post['title']; ?></td>
        <td><?php echo $post['content']; ?></td>
        <td>
            <div class="btn-group">
                <a href="<?php echo site_url('admin/blog/show'); ?>" class="btn btn-success">Edit</a>
                <a href="#" class="btn btn-danger">Delete</a>
            </div>
        </td>
    </tr>
<?php } ?>
在哪里发送
$post['id']

我在SO中看到一些问题,但答案是硬代码…

这里我们有一个例子

echo anchor('news/local/'. $post['id'], 'any text', array('title' => 'The best news!'));
在你的控制器中,你会得到类似的东西

echo $this->uri->segment('3');
还可以加载url帮助程序/库。

这里我们有一个示例

echo anchor('news/local/'. $post['id'], 'any text', array('title' => 'The best news!'));
在你的控制器中,你会得到类似的东西

echo $this->uri->segment('3');

还可以加载url帮助程序/库。

应该是这样的:

<a href="<?=site_url('admin/blog/show/'.$post['id']); ?>" class="btn btn-success">Edit</a>

更多信息:

应该是这样的:

<a href="<?=site_url('admin/blog/show/'.$post['id']); ?>" class="btn btn-success">Edit</a>

更多信息:

谢谢你,你帮助我了解更多关于锚函数和uri->segment的信息!谢谢你,你帮助我了解更多关于锚函数和uri->segment的信息!