syntax error, unexpected ',U' (T_STRING)

浏览:9935 发布日期:2016/11/14 分类:求助交流 关键字: U方法 error
<?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/baseController.class.php  LINE: 16
最佳答案
评论( 相关
后面还有条评论,点击查看>>