작동하지 않습니다 : 내 메가 바이트/Pushnotification을/etc/config.xml 파일의 코드젠토 : controller_action_predispatch 내가 controller_action_predispatch 이벤트 만들려고하고
을
<events>
<controller_action_predispatch_mbyte_pushnotification_index_index>
<observers>
<Mbyte_Pushnotification>
<class>Mbyte_Pushnotification/Observer</class>
<method>indexPreDispatch</method>
</Mbyte_Pushnotification>
</observers>
</controller_action_predispatch_mbyte_pushnotification_index_index>
</events>
내 컨트롤러 코드 : 메가 바이트/Pushnotification/컨트롤러/IndexController.php 파일 코드
class Mbyte_Pushnotification_IndexController extends Mage_Core_Controller_Front_Action
{
public function indexAction()
{
Mage::log('Run',null,'log.log');
}
}
관찰자 파일 코드 :
,class Mbyte_Pushnotification_Model_Observer {
public function indexPreDispatch($observer)
{
Mage::log('Check',null,'observer.log');
}}
controller_action_predispatch가 작동하지 않습니다. 내가 잘못하고있는 것이 있습니까?
하지만, 공공 기능 indexPreDispatch'처럼 $ 관찰자 캐스트 (Varien_Event_Observer의 $ 옵저버) ' – apouey
나는 이것을 시도했지만 나를 위해 작동하지 않았다 –