Certificated magento

2.5) Identify uses for events fired in the front controller

You can see them in  $this->getFrontController()->dispatch(); of Mage_Core_Model_App->run();

There are 4:

1) For getFrontController() - Mage_Core_Controller_Varien_Front->init() 

controller_front_init_before - the first event triggered and can be used for any sort or redirects, logging or benchmarking
controller_front_init_routers - here custom routers can be added
 
2) Mage_Core_Controller_Varien_Front->dispatch()
 
controller_front_send_response_before - last chance to set cookie, modify output or close benchmark. Note: That's why it is not a good idea to echo anything in action controller.
controller_front_send_response_after - here you can clean or write cache, log something, any other cleaning or action user doesn't have to wait for.

 

0 Bình luận

Trở về
  • 1.12) Set up a cron job
  • 1.12) Set up a cron job

    Let’s start with server setup.   As any complex system, Magento has a lot of tasks that need to be executed...