我正在尝试为 zend 框架项目创建一个模块化结构,我想做的是创建一个看起来像这样的模块
docroot/
index.php
application/
default/
controllers/
IndexController.php
FooController.php
models/
views/
scripts/
index/
foo/
helpers/
filters/
blog/
controllers/
IndexController.php
models/
views/
scripts/
index/
helpers/
filters/
news/
controllers/
IndexController.php
ListController.php
models/
views/
scripts/
index/
list/
helpers/
filters/
阅读文档后我无法理解的是在哪里添加以下代码,或者我应该重构 /zendlibrary/Controller/front.php 吗?
$front->setControllerDirectory(array(
'default' => '/path/to/application/controllers',
'blog' => '/path/to/application/blog/controllers'
));
或者
$front->addControllerDirectory('/path/to/application/news/controllers',
'news');