I have this module called "olo" that processes all our online orders.
Now I have created a new module called "olosec" because I want to make another version with a small modified stream and some other changes in some controllers.
Is it possible to extend the controller in "olosec" by the controller in "olo"?
At the moment I tried
class Olosec_CartController extends Olo_CartController
What causes the error, for example
Warning: include_once(Olo/CartController.php): failed to open stream: No such file or directory in /httpdocs/library/Zend/Loader.php on line 146 Warning: include_once(): Failed opening 'Olo/CartController.php' for inclusion. bla bla bla (include path) bla bla bla
My directory structure is something like this (thanks tree \F \A and EditPlus ++ )
+---application | +---views | | +---scripts | | +---layouts | | | +---default | | | +---admin | | +---languages | | +---helpers | +---modules | | +---admin | | +---mobile | | +---olo | | | +---controllers | | | IndexController.php | | | MenuController.php | | | CartController.php | | | OrderlistController.php | | | | | | | +---models | | | \---views | | | +---helpers | | | \---scripts | | | +---index | | | +---menu | | | +---cart | | | \---orderlist | | \---olosec | | +---controllers | | | IndexController.php | | | MenuController.php | | | CartController.php | | | OrderlistController.php | | | | | +---models | | \---views | | +---helpers | | \---scripts | | +---index | | +---menu | | +---cart | | \---orderlist | +---models | +---controllers | \---configs +---library +---public | +---cli | \---default +---tests \---data
Update
I used this "nasty" hack that works
require_once( APPLICATION_PATH . '/modules/olo/controllers/CartController.php');
Update @Rakesh
I have this in my bootstrap.
function _initAutoloader() { $autoloader = Zend_Loader_Autoloader::getInstance(); $autoloader->setFallbackAutoloader(true); return $autoloader; }
In my application.ini application
autoloadernamespaces.0 = "Zend" autoloadernamespaces.1 = "My" autoloadernamespaces.2 = "Something"
source share