Exemplo n.º 1
0
 public function testLoader()
 {
     $themeLoader = new XmlThemeLoader();
     $theme = $themeLoader->load(__DIR__ . '/../themes/demo/theme.xml');
     $this->assertEquals($theme->getName(), 'Demo');
     $siteLoader = new XmlSiteLoader();
     $site = $siteLoader->load(__DIR__ . '/../sites/demo/site.xml');
     $renderer = new Renderer();
     $html = $renderer->renderSitePage($theme, $site, 'home', 'en');
     echo $html;
 }
Exemplo n.º 2
0
 public function __construct(array $values = array())
 {
     parent::__construct($values);
     $this->configureParameters();
     $this->configureProviders();
     $this->initializeDomain();
     $app = $this;
     foreach ($this->site->getPages() as $page) {
         $app->get($page->getUrl(), function () use($app, $page) {
             $renderer = new Renderer();
             $html = $renderer->renderSitePage($this->theme, $this->site, $page->getName(), 'en');
             return $html;
         });
     }
 }