Frage

I'm trying to create an override for /classes/controller/FrontController.php. For testing purposes, I got the original method written like this:

protected function canonicalRedirection($canonical_url = '')
{
    die('Original method');
    ...

and the testing class /override/classes/controller/FrontController.php is written like this

class FrontController extends FrontControllerCore
{
    protected function canonicalRedirection($canonical_url = '')
    {
        die('Overriden method');
    }

}

But it always outputs Original method

Is there something i'm doing wrong? By the way, this works on different domain, but not on the one I'd like it work, so there is probably even more complicated stuff going on.

Thanks for any kick!

War es hilfreich?

Lösung

In order to override FrontController you need to add new file in override/classes/FrontController.php

Andere Tipps

Shouldn't the override be in /override/classes/FrontController.php - haven't look at any version later than 1.5.0.3 though, so they may have moved things around... again.

It's confusing but the FrontController class isn't a controller; it's a base class.

EDIT: Well.... I just had a look at 1.5.0.17 and they have indeed moved it. Looks like a bug to me :(

Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top