Наследование: extends Gc\Core\Object
Пример #1
0
 /**
  * Add path in Zend\View\Resolver\TemplatePathStack
  *
  * @param string $dir Directory
  *
  * @return \Gc\Module\AbstractPlugin
  */
 public function addPath($dir)
 {
     if (empty($this->renderer)) {
         $this->renderer = new Renderer();
     }
     $this->renderer->addPath($dir);
     return $this;
 }
Пример #2
0
 /**
  * Render template from event params
  *
  * @param EventManager\Event $event    Event
  * @param array              $template Template data
  *
  * @return string
  */
 public function render(EventManager\Event $event, $template)
 {
     if (empty($this->renderer)) {
         $this->renderer = new Renderer();
         $this->renderer->addPath($this->getTmpPath());
     }
     $name = sprintf('event-%s-%s', str_replace(array('\\', '/'), '-', $template['event_identifier']), $template['event_name']);
     file_put_contents($this->getTmpPath() . '/' . $name . '.phtml', $template['template']);
     return $this->renderer->render($name, array('event' => $event));
 }