From a magento observer how can I tell action type
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.
精彩评论