Exemple #1
0
 public static function setView($module, $controller, $action)
 {
     $envOptions = array('cache' => APP . DS . 'tmp' . DS . 'twig', 'auto_reload' => true);
     // Opciones de Twig
     $templateBasePath = APP . DS . 'modules' . DS . $module . DS . 'views';
     // Directorio de plantillas
     $templateName = $controller . DS . $action . '.html';
     // Plantilla a renderizar
     if (file_exists($templateBasePath . '/' . $templateName)) {
         self::$_view = new View($templateName, $templateBasePath, $envOptions);
     } else {
         header('HTTP/1.0 500 Internal Server Error');
         exit("<h1>500 Internal Server Error</h1>View could not be found.");
     }
 }