Translator

zend

How to include a user define class file in zend controller file

Disclaimer: This tutorial was taken from linked in, just for the sake of my reference.

Ramesh Chetipalli • To add user define class (or custom library) u can use zend framework’s autoloader namespaces.

Add the below line in application.ini file

autoloaderNamespaces.custom = “Custom_”

All the user defined classes will start ‘Custom_’ as prefix (e.g. Custom_Abc). The path for the file will be – /library/Custom/Abc.php

In the controller u can use – $abc = new Custom_Abc();