theme.php (469B)
1 <?php 2 class ControllerEventTheme extends Controller { 3 public function index(&$route, &$args) { 4 // This is only here for compatibility with old templates 5 if (substr($route, -3) == 'tpl') { 6 $view = substr($route, 0, -3); 7 } 8 9 if (is_file(DIR_TEMPLATE . $route . '.twig')) { 10 $this->config->set('template_engine', 'twig'); 11 } elseif (is_file(DIR_TEMPLATE . $route . '.tpl')) { 12 $this->config->set('template_engine', 'template'); 13 } 14 } 15 }