I am trying to create a Modular structure to zend framework project, what i am trying to do is create a module which will look something like this
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/
what i cant understand after reading the documentation is where to add the following code or should i refactore the /zendlibrary/Controller/front.php ?
$front->setControllerDirectory(array(
'default' => '/path/to/application/controllers',
'blog' => '/path/to/application/blog/controllers'
));
OR
$front->addControllerDirectory('/path/to/application/news/controllers',
'news');
Adding a method to your bootstrap is probably the easiest way: