Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<h2>Update</h2> <p>Even though I highly discourage your directory structure, it's your application and you should structure it however you like.</p> <p>To load multiple controllers, you should create a Front Controller Plugin to add paths to the controller directories stack</p> <pre><code>class My_Controller_Plugin_Paths extends Zend_Controller_Plugin_Abstract { public function preDispatch() { // Something like this... // Would be best to load paths via config/database or somewhere $dispatcher = Zend_Controller_Front::getInstance()-&gt;getDispatcher(); $dispatcher-&gt;addControllerDirectory('/path/to/website1.com/controllers') -&gt;addControllerDirectory('/path/to/website2.com/controllers'); } } </code></pre> <p>This is entirely untested, but you get the idea. Just make sure you register the plugin with the Front Controller in you bootstrap</p> <hr> <p>I'd agree with @Laykes. This is a badly structured application.</p> <p>I'm not sure of your exact requirements, but if it were my application, I would try to structure it like this:</p> <pre><code>/application /modules /default /controllers /IntexController.php // Default_IndexController /Website1com /IndexController.php // Default_Website1com_IndexController (possibly extends Default_IndexController) </code></pre> <p>Here you can see a properly structured class inheritance without creating totally separate, and probably duplicate, application folder.</p> <p>Autoloading anything like this though totally depends on you and your priorities. You could do a number of things, each with their own +ve's and -ve's.</p> <ul> <li>You could throw all paths into your include_paths in the order you want</li> <li>Check files exist and load from a front controller plugin</li> </ul> <p>To name a couple.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload