示例#1
0
 /**
  * Render a template and it's main page content.
  *
  * @param string $template
  *   The main template to render within the template.
  * @param bool $return_as_string
  *   When TRUE, the output will be returned instead of output.
  *
  * @return string
  *   The rendered content.
  */
 public function render($template = null, $return_as_string = false)
 {
     if (!$return_as_string) {
         Output::sendCookies();
     }
     // Get the default template if none is supplied.
     if (empty($template)) {
         $template = $this->template;
     }
     $this->setTemplateMetaData();
     if ($return_as_string) {
         return $this->build($template, true);
     } else {
         print $this->build($template, false);
     }
 }