I'm getting started with ZendFramework-1.10.5 (Windows 7, WampServer2.0h)
I have a resource folder like the following:
resources/ (RESOURCE_PATH)
models/
Test.php (class: App_Test.php)
forms/
Login.php (class: App_Form_Login.php)
This is the Autoloader:
$autoLoader = new Zend_Loader_Autoloader_Resource(array(
'basePath' => RESOURCE_PATH,
'namespace' => 'App',
'resourceTypes' => array(
'model' => array(
'path' => 'models/',
'namespace' => ''
),
'form' => array(
'path' => 'forms/',
'namespace' => 'Form'
)
)
));
It looks fine following the document of "Resource autoloader usage"
(http://framework.zend.com/manual/en/zend.loader.autoloader-resource.html),
but:
$loginForm = new App_Form_Login(); => it works fine;
$test = new App_Test(); => Fatal error: Class 'App_Test' not found
If I remove 'namespace' of 'model'
'model' => array(
'path' => 'models/'
),
=> Fatal error: Initial definition of a resource type must include a
namespace
What is the problem?
--
View this message in context:
http://zend-framework-community.634137.n4.nabble.com/problem-with-Zend-Loader-Autoloader-Resource-tp2244044p2244044.html
Sent from the Zend Framework mailing list archive at Nabble.com.