With ZF1 there was a bootstrap file defined under application/Bootstrap.php but I can’t find it when looking at the ZF2 skeleton application.
What is the ZF2‘s equivalent to the ZF1 Bootstrap.php file?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
In ZF2, there is no individual Bootstrap file as there was in ZF1. You can however, add an
onBootstrap()method to any of yourModuleclasses so it will be called afterloadModule.postonce$application->bootstrap()is called.On github in the ZF2 Skeleton App, the file you would add an
onBootstrap()method to is located at module/Application/Module.php.Here is some relevant documentation on Bootstrapping from the ZF2 user guide (note: any of this material is subject to change).
The MVC Bootstrap Event
Bootstrapping an Application
Bootstapping (in relation to MVC)
Sample usage of the MVC Bootstrap Event