Procházet zdrojové kódy

agregue error cuando la plantilla no se encuentra

Luciano Andrade před 7 roky
rodič
revize
5f0fe99477
1 změnil soubory, kde provedl 4 přidání a 2 odebrání
  1. 4 2
      Services/TemplateService.php

+ 4 - 2
Services/TemplateService.php

@@ -54,8 +54,11 @@ class TemplateService
         $template = $this->getTemplateByName($name);
         if (!is_null($template)) {
             $content = $this->render($template, $params);
+	    var_dump($content);
             $filename = $this->createFile($content, $filename);
-        }
+	}else{
+		throw new \Exception ("Template $name not found"); 
+	}
         
         return $filename;
     }
@@ -74,7 +77,6 @@ class TemplateService
         $twig = new \Twig_Environment($loader, array(
             'cache' => false,
         ));
-        
         return $twig->render($template->getName(), $params);
     }