예제 #1
0
 public function render($template, $data = array(), array $options = array())
 {
     $this->_context = $options['context'] + $this->_context;
     $this->_data = (array) $data + $this->_vars;
     $renderer = new Renderer();
     return $renderer->render(file_get_contents($template), $this->_context + $this->_data);
 }
예제 #2
0
 /**
  * returns rendered content
  *
  * @param string $content input content
  * @param array $data additional data to be passed into render context
  * @param array $options an array with additional options
  * @return string content as given
  * @filter
  */
 public function get($content, $data = array(), array $options = array())
 {
     $defaults = array('allowed' => true);
     $options += $defaults;
     $params = compact('content', 'data', 'options');
     return $this->_filter(__METHOD__, $params, function ($self, $params) {
         $renderer = new Renderer($params['content'], $params['data']);
         return $renderer->render();
     });
 }