Cool. So if I did it that way, my admin module would still be able to load and use default models?
Also, since I have yet to get this working, if I do that, I assume I don't need to have a different index.php on the public site in an admin directory, but ZF will know to route stuff from http://mysite.com/admin/blah/blah to the correct controller? The other thing I need to set up is an API directory for SOAP API calls. I want to make that http://mysite.com/api/... How should I go about setting that up, and using a different bootstrap for handling the SOAP requests? Or for that should I have a separate /api/index.php file and bootstrap the environment differently since I don't need all the front controllers etc? Also, one thing I am still lost on. In the quick start it says to put this in so the models will load correctly: protected function _initAutoload() { $autoloader = new Zend_Application_Module_Autoloader(array( 'namespace' => 'Default', 'basePath' => dirname(__FILE__), )); return $autoloader; } How do I then add in the code you suggest below for the Admin module? Is there a way to gang both of these together in the _initAutoLoad() bootstrap code? It is not clear to me if I need to pass an array of arrays to the Zend_Application_Module_Autoloader when I create it, or if I can someone create TWO of these? Or am I missing something fundamental here? Regards, Kendall Bennett, CEO A Main Hobbies 424 Otterson Drive, Suite 160 Chico, CA 95928 1-800-705-2215 (Toll-Free) 1-530-894-0797 (Int'l & Local) 1-530-894-9049 (Fax) http://www.amainhobbies.com ________________________________ From: Tom Shaw <[email protected]> Date: Sun, 3 May 2009 18:34:49 -0700 To: Kendall Bennett <[email protected]>, Zend Framework General <[email protected]> Subject: RE: [fw-general] Multi module layout? I'm not sure if there's a way to setup an admin module directly thru application.ini I was trying o make my bootstrap an *almost* complete stub taking advantage of application.ini there's a lot to be said but anyway that's off topic in my boot strap I just added $front->addControllerDirectory(APPLICATION_PATH . '/admin/controllers', 'admin'); $front->addModuleDirectory(APPLICATION_PATH . '/admin'); And in my autoloader I added $loader = new Zend_Application_Module_Autoloader(array( 'namespace' => 'Admin', 'basePath' => APPLICATION_PATH . '/admin') ); >From there you can access forms and modules like so, $user = new Admin_Model_Users() $form = new Admin_Form_UserForm() $user = new Defulat_Model_User() Tom Shaw [email protected] From: Kendall Bennett [mailto:[email protected]] Sent: Sunday, May 03, 2009 5:06 PM To: Zend Framework General Subject: [fw-general] Multi module layout? I am still struggling to figure out how to correctly configure everything in ZF 1.8.0 to set up a structure similar to the following: /application /configs /controllers /layouts /models /views /modules /admin /controllers /layouts /views /library Ie: I want to have an admin application module that will have all it's own controllers, layouts and views, but I want it to share the models and even the view helpers across the admin and front end applications. I suppose I could configure the helpers so that they come out of the library directory, and I could put the models into the library directory also. But I am still stuck on how to configure the autoloader and the router so that it will correctly handle these two different applications. Or should I be setting up an entirely separate /public/admin/index.php file for the admin side? And have it bootstrap the admin side separately, but set up name spaces to get to the shared models and view helpers? How exactly would I set up the name space for the view helpers so that if I made a view helper for $this->dateFormat(), that it would load MyApp_View_Helper_DateFormat rather than Zend_View_Helpder_DateFormat? Regards, Kendall Bennett, CEO A Main Hobbies 424 Otterson Drive, Suite 160 Chico, CA 95928 1-800-705-2215 (Toll-Free) 1-530-894-0797 (Int'l & Local) 1-530-894-9049 (Fax) http://www.amainhobbies.com
