我有以下示例代码:
控制器
public function one()
{
$this->two();
// url equals localhost/project/index.php?/one
}
public function two()
{
// some code..
// url still equals localhost/project/index.php?/one
}
每当我在one()下调用two()时,如何将URL更改为 localhost / project / index.php?/ two ?
答案 0 :(得分:0)
希望此示例将帮助您理解路线概念:
控制器
class Abc extends CI_Model {
public function one()
{
}
public function two()
{
}
}
config => 路由
$ route ['new-first-url'] ='abc / one';
$ route ['new-second-url'] ='abc / two';
在浏览器网址中-