jacmoe, on 15 July 2012 - 04:03 PM, said:
Perhaps a behavior?
Could either be controller behavior or model behavior. Or perhaps even both?
That would probably be the best way to do it.
And ensure that it will coexist with other extensions.
I'm a newbie to Yii but reasonably experienced in general OOP development, and it sounds odd to me. The OOP idea of classes extending each other is that they are related. eg
class Dog extends Mammal
A Controller extending a Module is different to this principle, or even the base controller extending a modules controller is upside down. Bit more like:
class Fish extends Dog
If all you want is the class functions to be available to all controllers, why not just do
Yii:app->getModule()->...
in your controllers?
I haven't got to behaviours yet in my reading so I won't say anything more!

Help













