Home  >  Q&A  >  body text

After adding parent::initialize();, an error is reported

protected function _initialize(){

parent::initialize();//Inherit the initialization operation in the parent class

define('USER_ID', Session::get('user_id '));

}

In the Base controller, an error is reported after adding parent::initialize();. Why is this?


phpcn_u43886phpcn_u438862457 days ago1285

reply all(4)I'll reply

  • 酱油哎呦

    酱油哎呦2017-11-09 17:03:57

    protected function _initialize(){

    parent::_initialize();    //修改这里

    define('USER_ID', Session::get('user_id'));

    }


    reply
    0
  • 鸢尾花

    The top and bottom are corresponding and cannot be modified.

    鸢尾花 · 2018-01-03 18:58:14
    宇瞳

    The yarn cannot be modified. Mine is 5.0.15, and the one in think controller is underlined.

    宇瞳 · 2018-04-03 17:07:06
  • nearest

    nearest2017-10-26 00:25:47

    Is there a parent class?

    reply
    0
  • Cancelreply