We often encounter the problem of writing our own custom functions or classes and their placement.
So, to add a custom class (or custom library), you can use the zend framework autoload namespaces.
Add the following line to the application.ini file
autoloaderNamespaces.custom = "Custom_"
OR
autoloaderNamespaces[] = "Custom_"
All user classes will be stored in the library directory. Create the name of the "Custom" folder in the library folder (which is defined in application.ini).
Classes will have the prefix "Custom_" when declared in a file (for example, Custom_Test)
Now we can use this class as $test = new Custom_Test() in our application.
Muhammad yaseen
source share