예제 #1
0
 protected function getPage($page, $xray = false)
 {
     $source = $this->pages->getPage($page, $xray);
     if (!$source) {
         throw new Nette\Application\BadRequestException("Page '{$page}' not found");
     }
     if ($source->data) {
         $data = \Nette\Utils\Json::decode($source->data);
     } else {
         $data = null;
     }
     $template = $this->createTemplate("\\Nette\\Templating\\Template");
     $template->heading = $source->heading;
     $template->data = $data;
     $template->setSource($source->body);
     return $template;
 }