在验证类里面加上public $uid=Cookie::get('uid')这句话就会报错 这是为什么?cookie不能这样用吗?
<?php
namespace app\index\validate;
use think\Validate;
use think\facade\Cookie;
class User extends Validate
{
public $uid=Cookie::get('uid');
protected $rule = [
'uid' => 'number|between:1,120',
];
}
- 3 回答
- 0 关注
- 1315 浏览
添加回答
举报
0/150
提交
取消