基类
定义两个变量,并共享到所有模板里
class basecontroller extends controller{ public $module; public $parent_module; public function __construct() { view::share('active',[$this->module=>'active']); view::share('parent_active',[$this->parent_module=>'active']); }}
继承的类
(赋值变量)
class shopcategorytagcontroller extends basecontroller{ public $module = 'cate_tag'; public $parent_module = 'parent_shop';
视图层
父级
子级
效果: