示例#1
0
 public function show($name)
 {
     $datas = $this->entityManager->find($name);
     $template = ConfigManager::getTemplate($this->directory, $name);
     $templateDirectory = ConfigManager::getTemplateDirectory($this->directory, $name);
     return $this->app->render("{$templateDirectory}/{$template}.twig", compact('datas'));
 }
 public function parse($filename)
 {
     foreach ($this->files as $file) {
         if ($file['name'] == $filename) {
             $doc = Parser::parse(file_get_contents($file['path']))->setConfig('url', ConfigManager::getUrl($this->entity) . '/' . $file['name']);
             if ($file['parser']) {
                 $html = self::parseMarkdown($doc->getContent());
             } else {
                 $html = $doc->getContent();
             }
             $doc->setConfig('content', $html);
             return $doc;
         }
     }
 }