CommonAction.class.php
-----------------------------------
Class CommonAction extends Action{
Public function _initialize(){
if (!isset($_SESSION['id'])){
$this->error('你没有权限,请重新登录', '__APP__/Login');
}
}
IndexAction.class.php
-------------------
class IndexAction extends CommonAction {
}这样是没问题的,但是3.2.2有点迷糊了,是怎么写呢?CommonController.class.php
----------------
namespace Admin\Controller;
use Think\Controller;
Class CommonController extends Controller{
Public function _initialize(){
if (!isset($_SESSION['id'])){
$this->error('你没有权限,请重新登录', '__APP__/Login');
}
}
IndexController.class.php
------------------------------
namespace Admin\Controller;
use Think\Controller;
class IndexController extends CommonController{
}结果运行是Namespace declaration statement has to be the very first statement in the sc
错误位置
FILE: C:\Users\Administrator\desktop\phpStudy\WWW\AimeeBlog3.2.2\Blog\Admin\Controller\CommonController.class.php LINE: 3
求大神 ~~~~~
最佳答案