开发者

From a magento observer how can I tell action type

开发者 https://www.devze.com 2023-02-11 02:58 出处:网络
How can I know if an action is front end or backend from within t开发者_Python百科he code of an observer for the controller_action_layout_render_before event ?This returns true if currently in backend

How can I know if an action is front end or backend from within t开发者_Python百科he code of an observer for the controller_action_layout_render_before event ?


This returns true if currently in backend.

Mage::app()->getStore()->isAdmin()


Do a print of the object observer to log file to see if you can find any data which acts as a clue to what you need:

Mage::log("observer object:" . print_r($observer, true));

I think there may be a data field which contains the event which fired the observer from there. Please post back your findings!

Hope this helps.

0

精彩评论

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