Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on May 5th, 2012  |  syntax: None  |  size: 1.11 KB  |  hits: 8  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. ZF not autoloading models and forms from module
  2. $myAccountModel = new User_Model_MyAccount();
  3.        
  4. Fatal error: Class 'User_Model_MyAccount' not found in F:My WebsfreedateapplicationmodulesusercontrollersMyAccountController.php on line 13
  5.        
  6. $loginForm = new Form_Login();
  7. $loginModel = new Model_Login();
  8.        
  9. require_once(APPLICATION_PATH . '/modules/user/models/MyAccount.php');
  10.        
  11. ; modules
  12. resources.frontController.moduleDirectory = APPLICATION_PATH "/modules"
  13. resources.modules[] =
  14.        
  15. /**  * Initialize autoloader  
  16.  * @return Zend_Loader_Autoloader  
  17.  */    
  18. protected function _initAutoload() {    
  19.     return Zend_Loader_Autoloader::getInstance();
  20. }
  21.  
  22. /**  * Initialize module autoloader  
  23.  * @return Zend_Application_Module_Autoloader  
  24.  */
  25. protected function _initModuleAutoload() {
  26.     $modelLoader = new Zend_Application_Module_Autoloader(array(
  27.             'namespace' => '',
  28.             'basePath' => APPLICATION_PATH . '/modules/default'));
  29.  
  30.     return $modelLoader;
  31. }
  32.        
  33. <?php
  34.  
  35. class User_Bootstrap extends Zend_Application_Module_Bootstrap
  36. {// nothing in here except you really want to do anything here ;)}