views:

30

answers:

1

hello all

i have 3 modules in my application , like following sturcture

application
   |
   default
     |---models
     |--views
     |--forms
     |--controller
  admin
     |---models
     |--views
     |--forms
     |--controller
  cars
     |---models
     |--views
     |--forms
     |--controller

bootstrap.php

how could i create autoloader for all forms and models in mouldes?

thanks?

+1  A: 

You just need module autoloader.

In application.ini:

resources.frontController.moduleDirectory = APPLICATION_PATH "/modules"
resources.modules[] =

Then create a bootstrap file in each module:

// /application/modules/cars/Boostrap.php
class Cars_Bootstrap extends Taat_Application_Module_Bootstrap
{
}

Autoloader will be automatically configured.

If you need further customization, take a look at: $this->getResourceLoader(); in this module bootstrap.

More information about bootstraping modules:
http://weierophinney.net/matthew/archives/234-Module-Bootstraps-in-Zend-Framework-Dos-and-Donts.html

takeshin