Example #1
0
 /**
  * Parses a template file and declares view variables in this scope for the
  * template to have access to them. Loads localized templates based on the current
  * active locale.
  * @param string The name of the template to load
  * @param array an associative array of values to assign in the template
  * @param string The file extension of the template to be loaded
  * @return  string The parsed html.
  */
 public static function parse($path, $variables = array(), $extension = '.php', $allowDebug = true)
 {
     $tpl = new self();
     $tpl->injectVariables($variables);
     $tpl->setViewName($path);
     $tpl->setConfig("file_extention", $extension);
     if (!(bool) $tpl->getConfig("allow_debug")) {
         $tpl->setConfig("allow_debug", false);
     } else {
         $tpl->setConfig("allow_debug", $allowDebug);
     }
     return $tpl->compile();
 }