TP5.1 Conroller 继承的疑惑

浏览:488 发布日期:2018/04/24 分类:ThinkPHP5专区
事情是这样的:

例如一个企业官网,有几个controller:index、about、contact
每一个都需要前置检查一下登录,所以有个 controller\first.php<?php
//controller\First.php
class First extends Controller{
    function _initialize(){
        //检查登录的代码
    }
}
然后其它controller一一继承<?php
//controller\About.php
class About extends First{
    function index(){
        
    }
}
从我学习使用 TP5.1起,发现这样不行了,不知现在要怎样搞
求解决办法,在线等
最佳答案
评论( 相关
后面还有条评论,点击查看>>