コード例 #1
0
ファイル: PageContentReader.php プロジェクト: Ravetracer/www
 /**
  * @param Content $c
  * @param string  $path
  *
  * @return Page
  */
 protected function transformContent(Content $c, $path)
 {
     $markdown = $c->getContent();
     $markdown = $this->removeProperties($markdown);
     $html = $this->parser->transformMarkdown($markdown);
     $html = $this->fixLinks($html, $path);
     $page = new Page();
     $page->setContent($html);
     $page->setProperties(new ArrayCollection(array_merge($page->getProperties()->toArray(), $c->getProperties()->toArray())));
     return $page;
 }
コード例 #2
0
ファイル: FileContentReader.php プロジェクト: Ravetracer/www
 /**
  * {@inheritDocs}
  */
 public function getContent($path)
 {
     $file = $this->getFilePath($path);
     $content = file_get_contents($file->getPathname());
     $properties = $this->readProperties($content);
     $content = $this->removeProperties($content);
     $c = new Content();
     $c->setContent($content);
     $c->setProperties(new ArrayCollection(array_merge($c->getProperties()->toArray(), $properties)));
     return $c;
 }