Note: You are currently viewing documentation for Moodle 2.3. Up-to-date documentation for the latest stable version is available here: Output renderers.

Development:Output renderers: Difference between revisions

From MoodleDocs
Line 23: Line 23:


==renderer_base==
==renderer_base==
Abstract class every other renderer must extend.


==core_renderer==
==core_renderer==

Revision as of 17:54, 7 January 2010

Note: This article is a work in progress. Please use the page comments or an appropriate moodle.org forum for any recommendations/suggestions for improvement.


Template:Infobox Project Template:Moodle 2.0

Goals

  • stable API
  • easy to use
  • easy to customise via themes

Renderers

Output renderer is a class with collection of methods that handle rendering of visual aspects of Moodle pages, emails, html export, etc. In 1.9 general output related functions were located in weblib.php and modules stored rendering code in lib.php, locallib.php, view.php, etc.

Output renderer instances are obtained through moodle_page::get_renderer($component, $subtype = null, $target = null) method. Current core_renderer is available through the global $OUTPUT variable, please note this global should not be used in low level APIs and scripts like cron.

Renderer targets

renderer_base

Abstract class every other renderer must extend.

core_renderer

core_renderer_cli

Core subsystem renderers

Plugin renderers

Theme renderers

HTML output

See also