Controller Inheritance

Hello,

I’m wondering what the best way to fix this problem is. This particular issue involves the ‘rights’ module.

First I have some properties that I have created in components/controller.php. Controller.php is extending RController.php (part of the rights module). My layout file makes use of the properties I have created in Controller.php. When I’m using the rights module I’m getting an error that my properties are not defined.

I’d rather not have to change the rights module itself as it makes upgrades more of a pain. Does anyone have a suggestion on the best way to go about this? Thanks in advance.

The controllers in the rights module inherit directly from RightsBaseController. Your Controller class is not used at all in this case. Hm, you are trying to modify the behavior of a module without modifying its code. Maybe you should look into implementing these properties in a subclass (say MyApplication) of the CApplication class and specify that class in your config file.

It should also be possible to attach a behavior to all the controllers from such a subclass ??? … I haven’t yet tried that.