/** * Constructor method, calls the parent constructor * * @param moodle_page $page * @param string $target one of rendering target constants */ public function __construct(moodle_page $page, $target) { if (empty($target) && $page->pagelayout === 'maintenance') { // If the page is using the maintenance layout then we're going to force the target to maintenance. // This way we'll get a special maintenance renderer that is designed to block access to API's that are likely // unavailable for this page layout. $target = RENDERER_TARGET_MAINTENANCE; } $this->output = $page->get_renderer('core', null, $target); parent::__construct($page, $target); }
/** * Constructor method, calls the parent constructor * * @param moodle_page $page * @param string $target one of rendering target constants */ public function __construct(moodle_page $page, $target) { $this->output = $page->get_renderer('core', null, $target); parent::__construct($page, $target); }