The standard autloader introduced in 1.12 allows you to use namespaces with minimal effort:
require 'Zend/Loader/AutoloaderFactory.php';Zend_Loader_AutoloaderFactory::factory([ 'Zend_Loader_StandardAutoloader' => [ 'autoregister_zf' => true, 'namespaces' => [ 'Application' => '/path/to/Application/src', ] ]]);
Now you can use Application\Form\Abc
instead of Application_Form_Abc
& Application\Model\Xyz
instead of Application_Model_Xyz
etc.
Directory/File structure examples:
path/to/Application/src/Form/Abc.php
<?phpnamespace Application/Form;class Abc {}
path/to/Application/src/Model/Xyz.php
<?phpnamespace Application/Model;class Xyz {}
聯(lián)系客服