如果实现这种方式呢? xx.com/Article/2 上图
看手册里标准方法是:域名/控制其名/方法名/参数
请教怎么实现隐藏方法名?
让参数默认传到 Index 方法中呢?
例如:http://www.xx.com/Article/1 这样的
class article extends CI_Controller {
public function __construct(){
parent::__construct();
$this -> load -> model('Home_model');
}
public function index($id)
{
// 系统信息
$data['SysConfig'] = $this -> Home_model -> getSysConfig();
exit('大家好,我是内容页');
}
}
现在打开 http://www.xx.com/article/1 这样的路径显示是404 用 URI 路由实现,具体请参考手册。 Hex 发表于 2014-12-5 16:08
用 URI 路由实现,具体请参考手册。
没有找到呢
zhangrongxi5 发表于 2014-12-5 16:14
没有找到呢
参考 http://codeigniter.org.cn/user_guide/general/routing.html
Hex 发表于 2014-12-5 16:15
参考 http://codeigniter.org.cn/user_guide/general/routing.html
靠谱!
页:
[1]