Override a package controller

Permalink
I would like to override the Multilingual controller.php file.
Located here: /packages/multilingual/controller.php

How would one go about copying that to the root (local) filesystem to override it?

I have tried creating a package directory called multilingual in the root controllers directory but no dice.

Any help appreciated.

 
mnakalay replied on at Permalink Reply
mnakalay
Hello,
I don't think it's possible.
Overriding a block's controller that's in a package is easy but the package's controller is its "identity" and its installer. Basically overriding it is the same as making it a new and different package.
smeranda replied on at Permalink Reply
smeranda
How do you override a block controller that's inside a package?
mnakalay replied on at Permalink Reply
mnakalay
Copy the block to application/blocks
smeranda replied on at Permalink Reply
smeranda
Thanks!

I incorrectly asked my question, how do you *extend* a package's block controller?

Your suggestion appears to override (which is what I originally asked). While I can make that work, I'd rather just extend with what I want.

Does that make sense?
mnakalay replied on at Permalink Reply
mnakalay
Same anSwer but make your new copied controller extend the original one.
smeranda replied on at Permalink Reply
smeranda
Hmmm, no love with that one. It's like the override causes it to ignore the original package controller?

namespace Application\Block\EventManagerList\Controller;
use \Concrete\Package\EventManager\Block\EventManagerList as EventManagerListController; 
class Controller extends EventManagerListController {
}


Error:

Class 'Concrete\Package\EventManager\Block\EventManagerList' not found
mnakalay replied on at Permalink Best Answer Reply
mnakalay
It should be
namespace Application\Block\EventManagerList;
use \Concrete\Package\EventManager\Block\EventManagerList\Controller as EventManagerListController; 
class Controller extends EventManagerListController {
}
smeranda replied on at Permalink Reply
smeranda
Ahh, that's the key. Thank you, that appears to have done the trick!
mnakalay replied on at Permalink Reply
mnakalay
Great to hear :)
BHWW replied on at Permalink Reply
BHWW
Hi, Did you ever manage to override/extend a package controller?

Thanks