0
我想分頁我的索引http:localhost/mysite/home但如果我只寫這個http:localhost/mysite/home頁面說:「page not found」,但如果我寫http :localhost/mysite/home/3它的工作!如何我可以配置我的路由獲取空參數?我試着用(:任何)和(NUM),但無法正常工作Codeigniter路由如何允許null參數
我的路線文件是:
$route['404_override'] = 'welcome/no_found';
$route['home/'] = "welcome/home/$1";
我的控制器:
$config['base_url'] = base_url().'/mysite/home';
$config['total_rows'] = $this->mtestmodel->countNews();
$config['per_page'] = 2;
$config['num_links'] = 20;
$this->pagination->initialize($config);
$data['paginator']=$this->pagination->create_links();
$data['news']=$this->mtestmodel->show_news($config['per_page'],intval($to));
// $到在URL BASE_URL參數()/ mysite的/家用/ 3