There are many problems with introducing constructors in th5
黄耀彬W
黄耀彬W 2018-09-11 22:39:29
0
2
1226

<?php

use app\common\controller\Base;

use app\common\validate\User;

use app\common\model\ User as UserModel;

class Test extends Base

{

public function test1(){

return $this-fetch ();

}

}

When the constructor is introduced, the template cannot be exported. Although it can be exported using the view function, many methods of the controller class cannot be used. , is there any good solution

黄耀彬W
黄耀彬W

reply all(1)
风行者

I have never used tp.

But remember to use parent::__construct() to inherit the parent class constructor for the subclass constructor

  • reply tp5+ is parent::_initialize(); don’t be scared to say it
    Coco author 2018-09-21 11:25:16
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template