コード例 #1
0
 public function render($sourcePath, $edit = false, $js = false)
 {
     $configuration = $this->getMetadataFromPath($sourcePath);
     if ($configuration === null) {
         return "[ERROR COMPILATED]";
     }
     $html = $this->getStaticSource($configuration);
     $htmlObject = \Artack\DOMQuery\DOMQuery::create($html);
     $containerObject = $htmlObject->find($configuration["container"]);
     $renderManager = new FrontSynchroniserRender($configuration);
     $renderManager->render($containerObject, $configuration["dom"], $edit);
     $output = $containerObject->getHtml();
     if ($edit) {
         $output = "<pre><code class='html'>" . htmlspecialchars($output) . "</code></pre>";
     }
     if (!$js) {
         $output = $renderManager->postRender($output, $edit);
     }
     return $output;
 }