I’ve read about folder structure in Zend Framework and I wanted to put my application logic into correct place folder called models.
I’ve also read that Zend by default uses Zend_Loader_Autoloader_Resource.
I’ve created subfolder My/Service and put there my php files.
Now I have copule of questions:
- Should classes in those files should be namespaced?
File is put in application/models/My/Service/Page.php
namespace My\Service;
class Page extends Service {
-
How should I access this class in code?
new Jubiler\Service\Page()
-
How prefixes and namespaces are related?
There are manyways for this..if you follow the exact naming concentions in zend framework..the class will load automatically ..heres the way\
1.In your config file add
appnamespace = “Foo”
If you have a File called Test.php in your library folder with a folder Bar (/libray/Bar/Test.php then the class name must be Foo_Bar_Test
In this way you can autoload the class