开发者

How to create a custom login for sfGuard user in Symfony?

I am using Sym开发者_运维问答fony 1.4 and ORM as Propel in my project. I have configured the Settings.yml to secure my page. But can i make a custom login/logout by my action extending all the SfGuard plugins functionality.i found one article in SymfonyLab, but was not clear enough.


Easiest way to override the view of sfGuard signin:

1) Create a directory called 'sfGuardAuth' in your frontend module:

mkdir apps/frontend/modules/sfGuardAuth
mkdir apps/frontend/modules/sfGuardAuth/templates

2) Copy the default templates from the sfGuardPlugin folder to the new module

cp plugins/sfGuardPlugin/modules/sfGuardAuth/templates/* apps/frontend/modules/sfGuardAuth/templates

3) Edit the new files to your hearts content

4) Clear cache

./symfony cc


You can also display the login form wherever you want. I have a page for users to register or login, so I did something like:

$this->signin = new sfGuardFormSignin();

then in the view you can do whatever you'd like.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜