我一直在 Kohana 3 上收到此错误消息
ErrorException [ 警告 ]: call_user_func() 期望参数 1 是有效的回调,未找到函数 'pages_save' 或无效的函数名
在我的控制器中,我有以下代码:
public function action_pages(){
return call_user_func('pages_'.$this->request->param('id'));
}
function pages_save(){
$this->auto_render = false;
}
如果我要访问 admin/pages/save 我应该被重定向到 pages_save() 函数对吗?但不知何故我不能?Kohana 不断向我抛出上述异常。我应该怎么做。在我看来,优化是一回事,如果我做 switch-case / if-else 块,如果我需要做的太多的话,我会永远花时间......