Is it possible in the current stable version of the Zend Framework (1.11), to work with application classes using PHP namespaces?
Application\Form\Abc instead of Application_Form_Abc
Application\Model\Xyz instead of Application_Model_Xyz
etc.
Starting from v1.10, ZF supports autoloading namespaces, and it's working fine when including namespaced libraries, but I was unsuccessful when trying to do the same job with application classes.
The standard autloader introduced in 1.12 allows you to use namespaces with minimal effort:
Now you can use
Application\Form\Abc
instead ofApplication_Form_Abc
&Application\Model\Xyz
instead ofApplication_Model_Xyz
etc.Directory/File structure examples:
path/to/Application/src/Form/Abc.php
path/to/Application/src/Model/Xyz.php
Actually there is a simple workaround suggested by Dmitry on the ZF issue tracker:
Works like a charm for me!