Events Magento—加载页面后执行的最后一个事件名称

Events Magento—加载页面后执行的最后一个事件名称,events,magento,observer-pattern,Events,Magento,Observer Pattern,在我的自定义模块中,我在会话变量中设置了一个标志,在controller\u action\u layout\u render\u before事件中,检查标志是否已设置,然后附加自定义内容 我想在页面加载后取消设置会话变量中的标志 怎样才能做到呢 加载页面时,是否有任何在末尾执行的事件? controller_front_send_response_after 这个活动应该对你有用。暂时将一些日志添加到app/Mage.php public static function dispatchE

在我的自定义模块中,我在会话变量中设置了一个标志,在
controller\u action\u layout\u render\u before
事件中,检查标志是否已设置,然后附加自定义内容

我想在页面加载后取消设置会话变量中的标志

怎样才能做到呢

加载页面时,是否有任何在末尾执行的事件?

controller_front_send_response_after
这个活动应该对你有用。暂时将一些日志添加到
app/Mage.php

public static function dispatchEvent($name, array $data = array())
{   
    //Mage::Log($name);                 
    file_put_contents('/tmp/event.log',"$name\n",FILE_APPEND);    

    Varien_Profiler::start('DISPATCH EVENT:'.$name);
    $result = self::app()->dispatchEvent($name, $data);
    #$result = self::registry('events')->dispatch($name, $data);
    Varien_Profiler::stop('DISPATCH EVENT:'.$name);
    return $result;
}

您可以获得为特定请求触发的事件列表,通常足以跟踪您自己正在查找的事件

> P>我希望你只为单个请求的生命存储变量,你可以考虑使用MaMeto的注册表。基本上,使用
Mage::register('some_variable_name',$variable)插入一个值Mage::registry('some_variable_name')在同一请求中的其他上下文中检索它

有关更多信息,请参阅@Alan Storm的答案