General developer forum

Request for comment on new plugin

Picture of marcello vitali
Request for comment on new plugin


I'm developing a new local/plugin that I called customclasses.

The aim of this plugin is:

- provide a mechanism to override through inheritance most of Moodle core classes (Eg. moodlepage,  any renderer, etc etc)

- this mechanism should be theme independent

- this mechanism should not conflict with standard moodle edition

- but rather co-exist so that one could quickly switch on/off according to his needs

- and obviously survive a moodle version upgrade

In its basic form the plugin ships with only an empty derived custom_page class

class custom_page extends moodlepage{

//you decide what to override



and a customloader class to use this class to initialise the $PAGE instance

and a plugin setting to switch on/off the plugin itself

and a couple of lines to add in config.php

While I know this is a rather controversial idea (and maybe already discarded by core developers), I think it still 

might interest someone and has some use cases.

I set up a github repository ( with a complete proof-of-concept implementation of the idea 

and extensive documentation.

I thank in advance anyone who will to take the time to review/comment/criticize my work.


Average of ratings: -
Tim at Lone Pine Koala Sanctuary
Re: Request for comment on new plugin
Core developersDocumentation writersParticularly helpful MoodlersPlugin developers

You can already substitute a different classe insteaed of moodle_page using this mechanism:

So, it has been thought about before. I am not sure it has ever been used.

Average of ratings: -
Picture of marcello vitali
Re: Request for comment on new plugin

Hi Tim,

thanks for replying.
Yes I had the impression the idea was not new.
In fact I wrote it was probably already discarded.

What my plugin does is propose a documented to way to structure it and also provide a full implementation of it. 

Average of ratings: -