Do we need renderers in new plugins at all?

Re: Do we need renderers in new plugins at all?

by Tim Hunt -
Number of replies: 0
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers

Your perfect world is not possible.

It would only be possible if the person creating some Moodle functionality could predict, in advance, all the data any one could ever possibly want to display as part of rendering this thing, and then pass all that to the renderer method/template. But, you cannot predict that, and even if you could it would be a performance problem (calling format_text on lots of bits of content that may, or may not, actually get output by this particular theme).

So, in practice, if you want Moodle output to be significantly customisable - and as we have said, we do - then you need to keep the renderer class in the loop, as a place in the API that you can hook into to do aribitrary stuff in PHP code.

Average of ratings: Useful (1)