简体   繁体   中英

Zend Framework dispatching frontcontroller or run Zend Application?

Recently I started out with developing in Zend Framework. I am using Zend Framework 1.11 since 2.0 is still in development and I can find more information on 1.11.

I have followed multiple tutorials and am trying to combine them for a project I am working on.

The thing is, and I just dont quite understand this. In the one tutorial the bootstrap file initialises Zend_Application and then bootstraps it and then runs this.

The other tutorial I was following is using Zend_Layout with MVC and dispatches the Frontcontroller .

What is the best practice for this? I need to use Zend_Layout and dispatching this and running the Frontcontroller / Zend_application gives me the exact same result.

I tried looking for the correct anwser but I cant find it..

Thanks in Advance

Zend_Application , ofcourse You can easily dispatch from the Frontcontroller, but it's the old way of dispatching ZF based apps.

Zend_Application was added later, and now it's best way to dispatch Your App 'coz of bootstrap & its resources:) You still can use frontcontroller's plugins etc.

Zend_Tool can create project for You and enable the layout. You can do it all from config file, thanks to Zend_Application:)

Your best bet is using Zend_Application. You can configure your layout in your config file.

resources.layout.layoutPath = APPLICATION_PATH "/layouts/scripts/"

Here is a good tutorial to look at

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM