Using Zend Framework I want to use controllers stored in a directory which is not default.
What I'm trying to achieve is that if the requested path begins with admin/ controllers/admin is used, with layout/admin and views/admin etc.
How would I go about achieving this in a reasonably graceful manner?
You could use the module directory structure. Create the directory structure
application
default
controllers
views
models
admin
controllers
views
models
For more info check out the docs on Using a Conventional Modular Directory Structure
$front = Zend_Controller_Front::getInstance();
$front->setControllerDirectory(...path...);
OR multiple paths
$front = Zend_Controller_Front::getInstance();
$front->setControllerDirectory(array(
'default' => '/path/to/application/controllers',
'blog' => '/path/to/application/blog/controllers'
));
http://framework.zend.com/manual/en/zend.controller.front.html