url怎么传值
example.com/class/function/ID1. 第一段表示调用控制器类。
2. 第二段表示调用类中的函数或方法。
3. 第三及更多的段表示的是传递给控制器的参数,如 ID 或其他各种变量。
实际在用的时候,
比如:<a href="<?php echo base_url()?>index.php/test">testing</a>--路径OK
现在我想传个参数过去该怎么弄呢?
中间那个方法应该写些什么,test中只有两个方法,一个是默认方法:test();另一个就是index()方法
我现在是<a href="<?php echo base_url()?>index.php/test/test/$id">testing</a>
就会出错
404 Page Not Found
The page you requested was not found. 不能在外部呼叫class=function,因为他是构造方法,ci不会让你调用 终于知道怎么弄了
http://127.0.0.1/php/CodeIgniter/index.php/test/index/1
页:
[1]