示例#1
0
 /**
  * Get the evaluated contents of the object.
  *
  * @return string
  */
 public function render()
 {
     if ($this->cacheKey === null) {
         throw new InvalidArgumentException('A cache key must be specified');
     }
     if ($this->updatedAt === null) {
         throw new InvalidArgumentException('A updated at timestamp must be specified');
     }
     if ($this->template == null) {
         throw new InvalidArgumentException('A valid template does not exist.');
     }
     if ($this->render == null) {
         $this->render = $this->template->render($this->data);
     }
     return $this->render;
 }
示例#2
0
文件: Template.php 项目: siipis/cms
 public function display(array $context, array $blocks = [])
 {
     $attr = Helper::getAttributes($this->getTemplateName());
     parent::display(array_merge($context, $attr), $blocks);
 }