我正在使用 Laravel,但new
关键字出现错误。我还是 OOP 概念的新手,我做错了什么?
错误:
Line 3: syntax error, unexpected 'new' (T_NEW)
代码:
class User extends Eloquent{
public static $user = new Fb();
public function mySnippets(){
return Snippet::all()->where('author','=',self::$user->getUser());
}
}
谢谢!