I am new to zend framework and trying to understand how the bootstrapping works. So far I have understood that the Zend_Application loads PHP environment, sets include paths, configures autoloaders and then calls the bootstrap method of the Bootstrap class.
The Bootstrap method executes all the resource methods (_init*()) and then it executes resource plugins.
My question is what happens if I configure the same resource using the resource method and using the resource plugin? Example below:
//Bootstrap resource method
protected function _initLayout(){
$this->bootstrap('layout');
$layout = $this->getResource('layout');
$layout->setLayout('index');
}
//Bootstrap resource plugin
resources.layout.layout = "main"
At present the resource plugin is called after the resource method so this should overwrite my layout and set it to "main" but this doesn't happen.
Shouldn't the plugin resources overwrite settings of our resource methods?
And what should I use for bootstrapping resource methods or resource plugins?
Thanks for your help.