2009年4月8日星期三

[fw-mvc] Autoloading module resources with 1.8 Preview

Hi,

I am using modular structure on ZF apps. I started to use
Zend_Application and autoloader now couple of weeks.

I was auto-loading module resources using this into an _initAutoloader()

foreach ($this->frontController->getControllerDirectory() as
$module => $dir)
{
$loaders[$module] = new Zend_Application_Module_Autoloader(
array(
'namespace' => ucfirst($module).'_',
'basePath' => dirname($dir),
) );
}

Now, when 1.8 Preview was released i noticed i can't auto-load the
modules resources,

So:

$acl = new 'MyModule_Model_Acl($auth);

Fatal error: Class 'MyModule_Model_Acl' not found in
D:\_Work\site\application\Bootstrap.php on line 154

This is failing...

How i am gonna auto-load resources for modules with or without their own
module bootstrapper ?

--
Best regards,
Cristian Bichis
www.zftutorials.com | www.zfforums.com | www.zftalk.com | www.zflinks.com

没有评论: