Пример #1
0
 /**
  * get template vars
  *
  * @return array|mixed
  * @throws \Exception
  */
 protected function getTemplateVars()
 {
     $repository = new Repository($this->settings);
     $defaults = ['content' => $this->page->getContent(), 'meta' => $this->page->getMeta(), 'current_page' => $this->page, 'base_dir' => rtrim(ROOT_DIR, '/'), 'base_url' => $this->settings['base_url'], 'config' => $this->settings, 'content_dir' => CONTENT_DIR, 'content_url' => $this->settings['base_url'] . '/' . basename(CONTENT_DIR), 'pages' => $repository->findAll(), 'site_title' => $this->settings['site_title'], 'theme_dir' => THEMES_DIR . $this->settings['theme'], 'theme_url' => $this->settings['base_url'] . '/' . basename(THEMES_DIR) . '/' . $this->settings['theme']];
     /** @var array $templateVars */
     $templateVars = Registry::get('templateVars');
     $templateVars += $defaults;
     return $templateVars;
 }
 public function findAll(array $options = array(), $folder = CONTENT_DIR)
 {
     $pages = parent::findAll($options, $this->folder);
     return $this->decorate($pages);
 }