-1
我得到錯誤default_method沒有定義笨_remap錯誤未定義default_method
這是我的URL訪問
- 管理/說明/ 1
的ID從數據庫中生成(此如果沒有_remap工作,但在_remap時不工作)
- 管理/說明/更新
我的公共功能更新()(如果沒有_remap & &有 _remap這不行)
這是我的控制器
public function _remap($method)
{
if ($method === 'update')
{
$this->$method();
}
else
{
$this->default_method();
}
}
public function index($id = NULL)
{
$exits_id = $this->Description_model->get_all_id();
if(count($exits_id) > 0)
{
foreach($exits_id as $exits_id):
$id_arr[]=$exits_id->desc_id;
endforeach;
}
if(!in_array($id, $id_arr))
{
show_404();
}
$viewdata['content']=$this->General_model->get_page_uri();
$viewdata['ha']='Indroduction/'. $id.'/';
$this->load->view("backend/content_view",$viewdata);
}
public function update()
{
echo 'update';
}
這是我的路線
$method_arr=array(
'Dashboard',
'Googlemap',
'Deccription',
'Slideshow'
);
foreach($method_arr as $method_arr){
$route['Admin/'.strtolower($method_arr)] = 'backend/'.$method_arr;
$route['Admin/'.$method_arr] = 'backend/'.$method_arr;
$route['Admin/'.strtolower($method_arr).'/(:any)'] = 'backend/'.$method_arr.'/$1';
$route['Admin/'.$method_arr.'/(:any)'] = 'backend/'.$method_arr.'/$1';
/*This 1 line above read my function method */
}
$route['Admin/Description/(:any)'] = 'backend/Description/index/$1';
/*This 1 line above read my index($id = NULL) */
錯誤:調用未定義的方法描述:: default_method()