在驗證類里面加上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 關注
- 1338 瀏覽
添加回答
舉報
0/150
提交
取消