Zf2 Application

Preparing the application

zf2_preparing_application.PNG
  1. In the preparation phase the application and all enabled modules are loaded.
  2. The ZF2 engine marks the end of a step and the beginning of a new step by emitting messages with a specific unique name.
  3. These messages in Zend Framework 2 are called events and the act of emitting a message is called triggering.
  4. The events in the preparation phase are "loadModules", "loadModule.resolve", "loadModule" and "loadModules.post".
  5. During the preparation phase all module configuration files are loaded and merged with the application configuration files to form the final configuration.
  6. The triggering of the "bootstrap" event. This causes the onBootstrap method in every loaded module to be called.
  7. In the onBootstrap method we can attach our event listeners.

Running the application

zf2_running_application.PNG
  1. Events triggered during this phase include "route", "dispatch", "render" and "finish".
  2. route is triggered first.
  3. The routing process reads the request parameters, such as method, URI, GET or POST parameters, and provides information about the module, controller and action that need to be loaded.
  4. dispatch is triggered when the action starts execution.
  5. render is triggered next if the application dictates visualizing the results.
  6. finish is triggered last.
Unless otherwise stated, the content of this page is licensed under Creative Commons Attribution-ShareAlike 3.0 License