diff --git a/rawilum/Pages.php b/rawilum/Pages.php index 4df8ba20..1a4bb94d 100755 --- a/rawilum/Pages.php +++ b/rawilum/Pages.php @@ -22,6 +22,9 @@ class Pages */ protected $rawilum; + /** + * @var Page + */ public $page; /** @@ -32,28 +35,6 @@ class Pages $this->rawilum = $c; } - /** - * Get page - */ - public function getPage($url = '', $raw = false, $url_abs = false) - { - - $file = $this->finder($url, $url_abs); - - if ($raw) { - $page = trim(file_get_contents($file)); - $this->page = $page; - $this->rawilum['events']->dispatch('onPageContentRawAfter'); - } else { - $page = $this->parse($file); - $this->page = $page; - $this->page['content'] = $this->rawilum['filters']->dispatch('content', $this->rawilum['markdown']->text($this->page['content'])); - $this->rawilum['events']->dispatch('onPageContentAfter'); - } - - return $this->page; - } - /** * Page finder */ @@ -128,6 +109,29 @@ class Pages return ['frontmatter' => $frontmatter, 'content' => $content]; } + + /** + * Get page + */ + public function getPage($url = '', $raw = false, $url_abs = false) + { + + $file = $this->finder($url, $url_abs); + + if ($raw) { + $page = trim(file_get_contents($file)); + $this->page = $page; + $this->rawilum['events']->dispatch('onPageContentRawAfter'); + } else { + $page = $this->parse($file); + $this->page = $page; + $this->page['content'] = $this->rawilum['filters']->dispatch('content', $this->rawilum['markdown']->text($this->page['content'])); + $this->rawilum['events']->dispatch('onPageContentAfter'); + } + + return $this->page; + } + /** * getPage */