【发布时间】:2012-06-02 22:53:23
【问题描述】:
我有一个名为 Categories 的控制器和一个名为 index 的函数,带有 1 个参数 $cat_id
所以它看起来像这样:
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
class categories extends CI_Controller {
function __construct(){
parent::__construct();
}
public function index($cat_id = null){
}
}
当我从浏览器调用它时,问题就来了……我用这个:
http://www.mysite.dev/categories/12311323
但返回404错误页面
如果我使用
http://www.mysite.dev/categories/index/12313131
会正常工作...
我怎样才能确保它在索引功能的 URL 中不需要索引?
【问题讨论】:
标签: php function codeigniter controller call