예제 #1
0
 public function doStuff(\Twig_Environment $twig, $file, $showCode = false, $wrapInIframe = false)
 {
     $node = self::$nodeRouter->findByPath($file);
     if ($node) {
         return $twig->createTemplate(self::$renderer->render($node, $showCode, $wrapInIframe))->render([]);
     }
     return '';
 }
예제 #2
0
 protected function findNode($path)
 {
     if (!$path) {
         throw new \Exception('404');
     }
     $node = $this->nodeRouter->findByPath($path);
     if (!$node) {
         $node = $this->nodeRouter->findByPath($path . '.md');
     }
     if (!$node) {
         throw new \Exception('404');
     }
     return $node;
 }