开发者

Zend Plugin works only in one module

I have created a plugin, that ckecks authorization status and gives access for using application. This plugin works fine, but in whole project. I want to make it works only in admin module. How can I do this? I have defined plugin in application.ini:

resources.frontController.plugins.authche开发者_运维技巧ck = Application_Plugin_AuthCheck

Thanks for your help.


One way:

admin.resources.frontController.plugins.authcheck = Application_Plugin_AuthCheck

Second way: check in plugin module's name:

if ($this->getRequest()->getModuleName() == 'admin') {
    //process
}
0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜