protected function render_page_layout($layoutfile) {
        global $CFG, $SITE, $USER;
        // The next lines are a bit tricky. The point is, here we are in a method
        // of a renderer class, and this object may, or may not, be the same as
        // the global $OUTPUT object. When rendering the page layout file, we want to use
        // this object. However, people writing Moodle code expect the current
        // renderer to be called $OUTPUT, not $this, so define a variable called
        // $OUTPUT pointing at $this. The same comment applies to $PAGE and $COURSE.
        $OUTPUT = $this;
        $PAGE = $this->page;
        $COURSE = $this->page->course;

        ob_start();
        include($layoutfile);
        $rendered = ob_get_contents();
        ob_end_clean();
        return $rendered;
    }
protected function render_page_layout($layoutfile) {
        global $CFG, $SITE, $USER;
        // The next lines are a bit tricky. The point is, here we are in a method
        // of a renderer class, and this object may, or may not, be the same as
        // the global $OUTPUT object. When rendering the page layout file, we want to use
        // this object. However, people writing Moodle code expect the current
        // renderer to be called $OUTPUT, not $this, so define a variable called
        // $OUTPUT pointing at $this. The same comment applies to $PAGE and $COURSE.
        $OUTPUT = $this;
        $PAGE = $this->page;
        $COURSE = $this->page->course;

        ob_start();
        include($layoutfile);
        $rendered = ob_get_contents();
        ob_end_clean();
        return $rendered;
    }
protected function render_page_layout ( $ layoutfile ) { global $ CFG , $ SITE , $ USER ; // The next lines are a bit tricky. The point is, here we are in a method // of a renderer class, and this object may, or may not, be the same as // the global $OUTPUT object. When rendering the page layout file, we want to use // this object. However, people writing Moodle code expect the current // renderer to be called $OUTPUT, not $this, so define a variable called // $OUTPUT pointing at $this. The same comment applies to $PAGE and $COURSE. $ OUTPUT = $ this ; $ PAGE = $ this -> page ; $ COURSE = $ this -> page -> course ; ob_start ( ) ; include ( $ layoutfile ) ; $ rendered = ob_get_contents ( ) ; ob_end_clean ( ) ; return $ rendered ; }
Renders and outputs the page layout file.

This is done by preparing the normal globals available to a script, and
then including the layout file provided by the current theme for the
requested layout.

@param string $layoutfile The name of the layout file
@return string HTML code
Renders and outputs the page layout file .