Zend Framework Autoloader question.

Posted by Andre on Stack Overflow See other posts from Stack Overflow or by Andre
Published on 2011-02-26T14:45:05Z Indexed on 2011/02/26 15:25 UTC
Read the original article Hit count: 227

Filed under:
|

In zend framework I register my namespace like this (in application.php):

'autoloaderNamespaces' => array(
    'Cms_'
)

And after this - I'd expect that Zend would always check that path in addition to Zend and ZendX paths if unknown class is called. But for some reason this doesn't work with for example view helpers.

I still have to register a separate path for my view helpers even though view helper scripts are named according to Zend coding standards and are located in:

Cms/View/Helper/

And this is how I register helper path in config file:

view' => array(
    'charset' => 'UTF-8',
    'doctype' => 'XHTML1_TRANSITIONAL',
    'helperPath' => array(
        'Cms_View_Helper_' => 'Cms/View/Helper'
        )
),

So - I'm not sure why I have to register "Cms" namespace twice first through 'autoloaderNamespaces' and then through View "helperPath"? Shouldn't Cms namespace include Cms/View/Helper namespace?

can someone plz clarify this:)

© Stack Overflow or respective owner

Related posts about php

Related posts about zend-framework