Esempio n. 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;
 }
Esempio n. 2
0
 public function display(array $context, array $blocks = [])
 {
     $attr = Helper::getAttributes($this->getTemplateName());
     parent::display(array_merge($context, $attr), $blocks);
 }