public static function get_vars() { if (DISPLAY_CURRENT_TIME) { Globals::set_var('display_current_time', true); } if (DISPLAY_DEBUG_INFORMATION) { Globals::set_var('display_debug_information', true); } Globals::set_var('current_time', date('d.m.Y - H:i:s', time())); Globals::set_var('Lare', Lare); Globals::set_var('version', "1.0.0a"); return self::$vars; }
public static function render() { if (TEMPLATE_CACHING) { header("Cache-Control: no-store, no-cache, must-revalidate, max-age=0"); header("Cache-Control: post-check=0, pre-check=0", false); header("Pragma: no-cache"); } self::$template_vars += Globals::get_vars(); self::set_template_var('Account', Globals::get_var('Account')); self::$template->addExtension(new Twig_Lare_Extension()); self::$template->addTokenParser(new Twig_Url_TokenParser()); self::$template->addTokenParser(new Twig_Trans_TokenParser()); self::$template->addTokenParser(new Twig_Time_TokenParser()); $filter = new Twig_SimpleFilter('utf8_encode', function ($string) { if (!mb_detect_encoding($string, 'UTF-8', true)) { return utf8_encode($string); } return $string; }); self::$template->addFilter($filter); echo self::$template->render(self::$template_name, self::get_template_vars()); }