Search the Community
Showing results for tags 'inheritance'.
Found 1 result
Hi, I'm currently working on a module that provides controller (as from mvc patterns) functionality for gathering data for page rendering (more to come soon). And now I'm facing a specific problem: I created an abstract controller class (lets say AbstractController) that extends WireData. This controller class is ment to be sub classed in ProcessWire projects by the project developers for each template that needs additional data to display. Now this abstract controller should get a hookable render() method. So I defined public function ___render(). Now if I try to hook in from another plugin via $this->addHookBefore('AbstractController::render', $this, 'doStuff'); nothing happends. Lets assume I have a HomeController extending AbstractController providin data for the home template. Now I can hook in via $this->addHookBefore('HomeController::render', $this, 'doStuff'); because HomeController inheritats the ___render() methods from its parent. The problem is, I don't want to hook into every concrete controller but into their common parent, the AbstractController, instead. Is there any solution to this problem? Regards, Marco