::class是啥意思?
'users' => [
'driver' => 'eloquent',
'model' => app\user::class,
],
搜半天不知道搜啥关键词。。
回复讨论(解决方案) 应该是user这个类下面的一个静态属性
app\user::class 返回类名 “app\user”
app\user::class 返回类名 “app\user”
感谢!根据您的返回类名4个字搜索了下。
php5.5t特性,获取完整类名称
php5.3 中引入命名空间的别名类和命名空间短版本的功能。虽然这并不适用于字符串类名称
use some\deeply\nested\namespace\foobar; // does not work, because this will try to use the global `foobar` class $reflection = new reflectionclass('foobar'); echo foobar::class;
为了解决这个问题采用新的foobar::class语法,它返回类的完整类别名称