简体   繁体   English

Symfony多个过滤器处理程序

[英]Symfony multiple filter handlers

I want to know if it is possible to add multiple handlers for the same filter. 我想知道是否可以为同一过滤器添加多个处理程序。 For my case I use sfGuardPlugins remember me filter, but I would like to use the remember me filter from sfFacebooConnectPlugin. 就我而言,我使用sfGuardPlugins“记住我”过滤器,但我想使用sfFacebooConnectPlugin中的“记住我”过滤器。

Can I make both these filters to work on the remember_me filter, or should I create my own filter handler which would treat both cases? 我可以使这两个过滤器都可以在remember_me过滤器上工作,还是应该创建自己的过滤器处理程序来处理这两种情况?

UPDATE: 更新:

I take that back. 我收回之前说过的话。 You can just use both filters. 您可以只使用两个过滤器。 What you need change is the logic in your login action. 您需要更改的是登录操作中的逻辑。 It would need to handle setting the proper cookies for BOTH filters. 它需要处理为两个过滤器设置适当的cookie。


You would need to modify the code for one of those filters in order to do it. 为此,您需要修改其中一个过滤器的代码。 Since they are both from plugins the best bet is to write your own filter that performs the functions of both of the exiting plugin filters. 由于它们都是来自插件,所以最好的选择是编写自己的过滤器,以执行两个现有插件过滤器的功能。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM