+ -
当前位置:首页 → 问答吧 → 在控制器里面调用公共函数错误

在控制器里面调用公共函数错误

时间:2011-09-15

来源:互联网



例如:
class HomeAction extends Action{
     funciton Common(){
         echo "这些是公共代码" ;
     }

     function index(){
         Common();          //运行这里错误了
          $this->display();
     }
}

错误代码:Call to undefined function Common()  ;

控制器里面不能调用函数?或者我的基础知识太差了!!求助

作者: dxnumber   发布时间: 2011-09-15

1是基础太差了。
2是代码写错了。

或许应该大概可能八成被不住是这样写的:

$this->Common();

作者: hajtjh   发布时间: 2011-09-16

确实是这样!!!多谢 hajtjh

作者: dxnumber   发布时间: 2011-09-16

好吧,我服了你

作者: deeka   发布时间: 2011-09-16

热门下载

更多