title: How to use a model class from a module in the application bootstrap in a Zend Framework based application?
body: <p>I am developing a Zend Framework MVC application with some modules, in example, the Users module. There is a model class name "Users_Model_User" that can be used in any module/controller operation. But I need to use an instance of that model in the application Bootstrap class, but there I get an exception:</p>
  
  <blockquote>
    <p>Fatal error: Class 'Users_Model_User' not found in /my/path/...</p>
  </blockquote>
  
  <p>I have a Bootstrap class for each module:</p>
  
  <pre><code>class Users_Bootstrap extends Zend_Application_Module_Bootstrap {
  
      protected function _initAutoloader() {
          $autoloader = new Zend_Application_Module_Autoloader(array(
                      'namespace' =&gt; 'Users_',
                      'basePath' =&gt; APPLICATION_PATH . '/modules/users'
                  ));
  
          return $autoloader;
      }
  
  }
  </code></pre>
  
  <p>and as I said, the modules are working just fine (reciving requests, processing and returning responses). I think this works fine due to the module bootstrap class, that takes care of loading the default module resources, like model classes. But the main Bootstrap class seems to lack of access to the "Users" module model classes.</p>