Пример #1
0
 /**
  * Setup before tests
  *
  * @return void
  */
 public function setUp()
 {
     mkdir('testtheme');
     file_put_contents('layout.html', "{{ layout.content|raw }}{{ something }}");
     mkdir('testtheme' . DIRECTORY_SEPARATOR . 'templates');
     file_put_contents('testtheme' . DIRECTORY_SEPARATOR . 'templates' . DIRECTORY_SEPARATOR . '_navigation.html', '{% for item in navigation %}{{ item.href(true) }}{% endfor %}');
     file_put_contents('testtheme' . DIRECTORY_SEPARATOR . 'templates' . DIRECTORY_SEPARATOR . '_subnavigation.html', '{% for item in navigation %}{{ item.href(true) }}{% endfor %}');
     $theme = new Theme('testtheme', '/', APP_PATH . DIRECTORY_SEPARATOR . 'tests');
     $theme->setDefaultTitle('[testing]');
     $this->_object = new Layout('layout.html', $theme);
 }
Пример #2
0
 /**
  * Make the theme object
  *
  * @param Greengrape\Request $request Request object
  * @return Greengrape\View\Theme
  */
 public function makeTheme(Request $request)
 {
     if ($request->preview_theme) {
         $themeName = $request->preview_theme;
     } else {
         $themeName = $this->getConfig('theme');
     }
     $theme = new Theme($themeName, $request->getBaseUrl());
     $theme->setDefaultTitle($this->getConfig('sitename'));
     return $theme;
 }