类似于网址
Index.php/constructor/method/1
我想获取ID。 我用过
anchor("constructor/method/{$article->id}",'Edit');
这不起作用,我收到以下错误:
Using non-object as object
如何检索 id 值?
最佳答案
如果您的“id”位于 URI 中:index.php/constructor/method/1
您可以使用 URI 库和段来获取值。
即。
uri:index.php/constructor/method/1
$id = $this->uri->segment(3);
请随意检查 this page 上的 URI 段操作的其他函数在文档中。
关于php - 如何在CodeIgniter中发送id值?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/42333130/