I'm trying to add a new folder to the application folder in zend framework, but none of the classes I create in the new folder can be found.
What I have is this structure:
application/
models/
modules/
services/
Test.php
I tried to call on the class Test.php:
class Service_Test{
}
$test = new Service_Test()
This results in the error: PHP Warning: include_once(): Failed opening 'Service/Test.php' for inclusion (include_path='...') in library/Zend/Loader.php on line 146.
(The include_path contains a list of directories, which I removed for privacy).
I thought that Services would be automatically found in the same way that Models are automatically found. Does anyone know how I can make Zend framework find the Services folder?
I tried this as well:
require_once('Zend/Loader.php');
Zend_Loader::registerAutoload();
$resourceLoader = new Zend_Loader_Autoloader_Resource(array(
'basePath' => ROOT_PATH . '/application',
'namespace' => 'Service',
));
PHP Fatal error: Class 'Service_Test' not found
services
? Your class isService_Test
; should that beServices_Test
, or is there a typo in the directory list? - Daren Chandisingh