<?php
namespace Admin\Controller;
use Think\Controller;
class BaseController extends Controller{
//构造方法
public function __construct(){
parent::__construct();//一定要调用父类的构造方法
$this->checkLogin();
}
//验证是否登陆
public function checkLogin(){
//通过session来验证
if(!$_SESSION['admin']){
//没有登陆
$this->error('请先登陆吧',U('Login/login'));
}
}
}
这一段代码为什么提示语法错误了,我是照着视频敲的。。错误提示就是运行后
syntax error, unexpected ',U' (T_STRING)
错误位置
FILE: /Applications/XAMPP/xamppfiles/htdocs/tp/Application/Admin/Controller/ba
最佳答案
