我已经设置了一个简单的symfony/skeleton应用程序,其中包含用户实体和身份验证。当身份验证成功后,我调用包含以下代码的路由: public function index(Security $security) $username = $security->getUser()->getUsername(); 这会导致错误: Call to a member function getUsername() on null 因此,很明显,安全组件现在没有关于当前
在由sfDoctrineGuardPlugin处理的登录过程中,如何设置用户区域性?每个用户都可以设置存储在sfGuardUserProfile表中的首选语言。($request);但显然我不能这样做,因为在执行父函数之前,我不能访问GuardUser对象。然后我考虑创建一个类似下面这样的postExectute()函数:{
i