Example #1
0
 /**
  * Render a template
  *
  * @param   string  $source    The template url or content
  * @param   array   $data       An associative array of data to be extracted in local template scope
  * @throws \RuntimeException If the template could not be loaded
  * @return string The rendered template source
  */
 public function render($source, array $data = array())
 {
     parent::render($source, $data);
     //Push the template on the stack
     array_push($this->__stack, $source);
     return $source;
 }
Example #2
0
 /**
  * Render the template
  *
  * @param TemplateContext   $context A template context object
  * @return string  The output of the template
  */
 protected function _actionRender(TemplateContext $context)
 {
     $source = parent::render($context->source, ObjectConfig::unbox($context->data));
     if ($context->type) {
         $source = $this->getObject('template.engine.factory')->createEngine($context->type, array('functions' => $this->getFunctions()))->render($source, $this->getData());
     }
     return $source;
 }