开发者

Zend framework Internal structure modification?

开发者 https://www.devze.com 2022-12-22 14:16 出处:网络
What class(FrontController , Bootstrap, Dispacher....) sets up the default s开发者_运维百科tructure path in ZF?There is no single instance that has all the paths. Each component has it\'s own defaults

What class(FrontController , Bootstrap, Dispacher....) sets up the default s开发者_运维百科tructure path in ZF?


There is no single instance that has all the paths. Each component has it's own defaults, e.g. the FrontController knows that the controller directory should be named controllers, but it doesn't know how to make a full path from it (Dispatcher does it) or where to find the Action Helpers. That's defined in ActionHelper Broker. Consequently, Zend_View_Abstract holds the paths for View filters, helpers and scripts, etc.

Like @Pascal mentioned in his comment, you should not modify ZF at it's core. You will lose the changes once you update to a newer version anyway. Configure the paths through the API in your bootstrap or through the application.ini instead.


Actually it's the dispatcher's job to find the requested action controller.

So you'll have to extend either Zend_Controller_Dispatcher_Abstract or Zend_Controller_Dispatcher_Standard or even create a completely new one based on Zend_Controller_Dispatcher_Interface to fit your requirements.

But be aware that you'll have to change the way Zend_Controller_Action_Helper_ViewRenderer tries to find the required view files, too.

0

精彩评论

暂无评论...
验证码 换一张
取 消