Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to register customized library in zend framework

I have created my own library in Zend framework for some custom requirements. The Prefix that I am using in each class is "Dtd_". I would like to know that how would I register this so that it could become available globally.

like image 839
DEE Avatar asked Nov 27 '25 20:11

DEE


1 Answers

There are a couple of methods to do this:

You can add namespaces in your application.ini file:

[production]
autoloaderNamespaces[] = "Dtd_"

Or, in your bootstrap:

protected function _initAutoloader()
{
    $autoloader = Zend_Loader_Autoloader::getInstance();
    $autoloader->registerNamespace("Dtd_");
}
like image 75
Richard Parnaby-King Avatar answered Dec 02 '25 06:12

Richard Parnaby-King