3067 Posts in 867 Topics by 649 members
|
Page:
1
|
Go to End | |
| Author | Topic: | 1329 Views |
-
How to extend Controller

30 March 2010 at 5:20am Last edited: 30 March 2010 5:21am
I've been working on an extension that will allow for multiple comment areas on a single page. I've got it working, and most of the functionality is all neatly contained within the extension. However, I've created three functions that are used within the templates, to specify where the comment areas should be defined.
Currently the only way I can get it to work is to define them in the _Controller class of the Page class I'm using in my system:
class Species_Controller extends Page_Controller {
function PageComments($location = null) {
:::::: code ::::::
}
}works.
If I try to extend the Extension class
class PageCommentMulti_Controller extends Extension {
function PageComments($location = null) {
:::::: code ::::::
}
}
and add that to the controller in the _config.phpObject::add_extension('Species_Controller', 'PageCommentMulti_Controller');
it doesn't work. There are no errors, the functionality just isn't shown in the templates.Is there a way to extract/abstract the Controller class allowing the functionality to be easily implemented in other systems and for other classes, without having to define the Controller functions manually?
| 1329 Views | ||
|
Page:
1
|
Go to Top |

