【发布时间】:2011-11-22 13:01:42
【问题描述】:
我在 Magento 中有一个控制器,如下所示:
#File: ./app/local/FilFact/Test/IndexController
class FilFact_Test_IndexController extends Mage_Core_Controller_Front_Action{
public function indexAction(){
$this->_testConfig();
}
}
我需要添加两个事件:before index actionafter index action
我该怎么做?
【问题讨论】:
-
您想提供这两个事件,以便其他模块可以挂钩,对吗?
-
是的,我使用如下方式:在索引操作中添加语句:
Mage::dispatchEvent('test_index_index_before_action',$data);。但这并不好。下面的答案更好。
标签: model-view-controller zend-framework magento