Magento Event On Any Page Load

后端 未结 4 699
伪装坚强ぢ
伪装坚强ぢ 2020-12-13 20:03

I am wondering if there is an event that is fired once every time a page is loaded before rendering to html in magento?

This might be useful if you want to do some b

4条回答
  •  小蘑菇
    小蘑菇 (楼主)
    2020-12-13 20:42

    I think you are looking for this event controller_action_layout_render_before_RouteName_ControllerName_ActionName

    you can also log all the events which are fired on any page load from Mage class in below function

    public static function dispatchEvent($name, array $data = array())
        {
            Mage::log($name);
            Varien_Profiler::start('DISPATCH EVENT:'.$name);
            $result = self::app()->dispatchEvent($name, $data);
            Varien_Profiler::stop('DISPATCH EVENT:'.$name);
            return $result;
        }
    

提交回复
热议问题