这是我与Symfony的第一个真正的项目.我需要在我的后端应用程序上有一些设置,如权限.
我知道,我必须使用sfDoctrineGuardPlugin.但我不知道怎么办?我在symfony网站上阅读了关于sfDoctrineGuardPlugin的内容.但我仍然没有找到任何关于;
非常感谢先进...
我正在使用 symfony1.4.16 和 Doctrine 开发一个项目,并且为了进行身份验证,我使用 sfDoctrineGuardPlugin。在我的本地主机中它工作正常。当我将项目移到共享主机上时,我Unknown record property / related component "permissions" on "sfGuardUser"在登录时收到此错误()。当我在 Google 中搜索此错误时,很多人都推荐delete all SFGuard Forms from lib/form/doctrine/base and reinstalling the plugin。我如何在我的共享主机上重新安装它?我应该采取什么步骤在我的共享主机上卸载它?我是否需要在本地主机中重新安装它并将其上传到我的服务器,或者我应该使用该命令symfony plugin:uninstall sfDoctrineGuardPlugin还是简单地删除其中的文件lib/form/doctrine/base并将其再次上传到我的服务器。与 sfDoctrineGuardPlugin 无关的其他模块工作正常。任何一个请帮我...
更多信息
当我登录时,我收到错误Unknown record property / related component "permissions" on "sfGuardUser",当我刷新页面时,错误消失,我正在重定向到主页。在主页我有链接
**
**
<?php
// Connection Component Binding
Doctrine_Manager::getInstance()->bindComponent('SfGuardUser', 'doctrine');
/**
* BaseSfGuardUser
*
* This class has been auto-generated by the Doctrine …Run Code Online (Sandbox Code Playgroud) 我正在使用Symfony和sfDoctrineGuardPlugin.
如何在模板中显示当前用户的用户名?
我已经尝试了$ this-> getUser() - > getUsername(),但我得到的只是错误:"调用未定义的方法sfPHPView :: getUser."
我正在尝试在layout.php中显示用户名,而不是在特定的模块/模板中
我已经启用了sfDoctrineGuardPlugin,所以我将myUser类更改为我的类扩展sfGuardSecurityUser.
我已经覆盖了sfGuardUser架构以添加我自己的关系
Personnage:
local: id
foreign: user_id
type: one
onUpdate: CASCADE
onDelete: CASCADE
Run Code Online (Sandbox Code Playgroud)
生成模型时,如果继续使用BasesfGuardUser.class.php,我可以在PHPDoc注释中看到我的关系已创建,并且已添加属性Personnage.
* @property Personnage $Personnage
Run Code Online (Sandbox Code Playgroud)
但我不明白,当我尝试访问此属性时,我不能.
在控制器中:
$user = $this->getUser();
$user->Personnage;
Run Code Online (Sandbox Code Playgroud)
在视图中:
echo $sf_user->Personnage
Run Code Online (Sandbox Code Playgroud)
而错误:
Notice: Undefined property: myUser::$Personnage
Run Code Online (Sandbox Code Playgroud)
我怎样才能访问这个属性?