Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Zend framework (1.7.5): how to change controller directory

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?

like image 710
Robin Barnes Avatar asked Dec 30 '22 04:12

Robin Barnes


1 Answers

$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

like image 77
Glavić Avatar answered Jan 14 '23 13:01

Glavić