コード例 #1
0
ファイル: ViewTest.php プロジェクト: gonzalo123/gfw
 public function testNamespaceNotFound()
 {
     $view = new View(__DIR__ . "/templates/cache", TRUE);
     try {
         $view->registerNamespace('App1', __DIR__ . '/templates');
         $twig = $view->getTwig('App\\Index');
     } catch (Exception $e) {
         $this->assertEquals("Namespace not found", $e->getMessage());
         $this->assertEquals(404, $e->getCode());
     }
 }
コード例 #2
0
ファイル: Index.php プロジェクト: gonzalo123/gfw
 /** @GET */
 public function html(View $view)
 {
     return $view->getTwig(__CLASS__)->render('index.twig', $this->json());
 }