Example #1
0
 /**
  * Returns the content from a given template
  *
  * @param  string $template  The template to use.
  * @param  array  $variables The variables to assign.
  * @return string
  */
 private function getTemplateContent($template, $variables = null)
 {
     // new template instance
     $tpl = null;
     if (APPLICATION === 'Backend') {
         $tpl = new BackendTemplate(false);
     } else {
         $tpl = new Template(false);
     }
     // set some options
     $tpl->setForceCompile(true);
     // variables were set
     if (!empty($variables)) {
         $tpl->assign($variables);
     }
     // grab the content
     return $tpl->getContent($template);
 }