public function test_lex_parser_in_themes() { Template::parse_views(true); Template::set_theme('default'); $file = FCPATH . 'themes/default/bf_parser_test.php'; // Create a simple file file_put_contents($file, '<span>{{ title }}</span>'); Template::set('title', 'Lex Is Working'); Template::load_view('bf_parser_test', null, '', true, $output); $this->assertTrue(class_exists('MY_Parser')); $this->assertEqual($output, '<span>Lex Is Working</span>'); // Remove the temp file unlink($file); }
/** * Enable/disable passing views through CI's Parser. * * @param boolean $parse If true, the views will be parsed. * @return void */ public function parse_views($parse = false) { self::$parse_views = (bool) $parse; }
public static function init() { // If the application config file hasn't been loaded, do it now if (!self::$ci->config->item('template.theme_paths')) { self::$ci->config->load('application'); } // Store our settings self::$site_path = self::$ci->config->item('template.site_path'); self::$theme_paths = self::$ci->config->item('template.theme_paths'); self::$layout = self::$ci->config->item('template.default_layout'); self::$default_theme = self::$ci->config->item('template.default_theme'); self::$parse_views = self::$ci->config->item('template.parse_views'); // Store our orig view path, so we can reset it self::$orig_view_path = self::$ci->load->_ci_view_path; log_message('debug', 'Template library loaded'); }
/** * Set whether or not the views will be passed through CI's parser. * * @access public * * @param bool $parse Boolean value. Should we parse views? */ public function parse_views($parse = FALSE) { self::$parse_views = (bool) $parse; }
public function parse_views($parse) { self::$parse_views = $parse; }