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 ''; }
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; }