Zend_Application issue with extending Frontcontroller and using extended Frontcontroller application resource

StackOverflow https://stackoverflow.com/questions/10405055

Question

I extended the Zend Frontcontroller with a personal one and also extended the frontcontroller application resource to use my personal front controller. All it basically does for the moment is assign the front variable within the application resource method getFrontController to my personal front controller. Lastly, I added the pluginpaths variable within application.ini to use my personal Application Resources. In any case, I'm getting the Zend Frontcontroller returned to me instead of my personal one. Anybody know why my personal application frontcontroller resource isnt being used? `

Was it helpful?

Solution

Since Zend_Controller_Front is a singleton, you will also need to override the getInstance() method to ensure it creates an instance of your class instead of the base class. You can just cut and paste the method to do this:

public static function getInstance()
{
    if (null === self::$_instance) {
        self::$_instance = new self();
    }

    return self::$_instance;
}
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top