Renders a template and returns a Response.

@param string   $template The template name
@param mixed    $context  The Mustache rendering context
@param Response $response A Response instance

@return Response A Response instance
16860
public function render($template, $context = array(), Response $response = null)
    {
        if ($response === null) {
            $response = new Response();
        }

        $response->setContent($this['mustache']->render($template, $context));

        return $response;
    }
99681
public function indexAction(Template $template)
    {
        $templating = $this->container->get('templating');

        $response = $this->getResponse(
            $templating->render(
                $template->getRenderName(),
                $template->getRenderData()
            )
        );

        return($response);
    }
599459
public static function create_template($template) {
        global $PAGE;

        $params = self::validate_parameters(self::create_template_parameters(), array('template' => $template));
        $params = $params['template'];
        $context = self::get_context_from_params($params);
        self::validate_context($context);
        $output = $PAGE->get_renderer('core');

        unset($params['contextlevel']);
        unset($params['instanceid']);
        $params = (object) $params;
        $params->contextid = $context->id;

        $result = api::create_template($params);
        $exporter = new template_exporter($result);
        $record = $exporter->export($output);
        return $record;
    }
906611
def render_to_string(template_name, context=None, request=None, using=None):
    
    if isinstance(template_name, (list, tuple)):
        template = select_template(template_name, using=using)
    else:
        template = get_template(template_name, using=using)
    return template.render(context, request)
677987
def render_template(request, app, template_name, context=None, subdir="templates", def_name=None):
    '''
    
    '''
    return get_template(app, template_name, subdir).render(context, request, def_name)
595706
protected function _afterRender(TemplateContextInterface $context)
    {
        if(is_string($context->result))
        {
            $content = $context->result;

            foreach($this->__filter_queue as $filter) {
                $filter->filter($content, $this->getMixer());
            }

            $context->result = $content;
        }
    }
422276
protected function render($template, $context = [])
    {
        $context = array_merge($this->_context, $context);
        $body = $this->twig->render($template, $context);
        return $body;
    }
80010
protected function render($template, $parameters)
    {
        $twig = $this->templating;
        $twig->setLoader(new \Twig_Loader_Filesystem($this->skeletonDirs));

        return $twig->render($template, $parameters);
    }
538443
public function setTemplate($template, $body = null)
    {
        $this->template = $template;

        if (!is_null($body)) {
            return $this->transform($body);
        }

        return '';
    }
688833
def render(self, name=None, template=None, context={}):
        ''''

        '''

        if isinstance(template, Template):
            _template = template
        else:
            _template = Template.objects.get(name=name)

        # Maybe cache or save local ?
        response = self.env.from_string(
            _template.content).render(context)

        return response
62628
def render(template, context=None, **kwargs):
    
    renderer = Renderer()
    return renderer.render(template, context, **kwargs)
837253
protected function responseTemplate($template, $data = array()){
        
        if(!isset(hubert()->template)){
            throw new \Exception("no template engine installed");
        }
        $html = hubert()->template->render($template, $data);
        $this->_response->getBody()->write($html);
        
        return $this->_response;
        
    }
1056814
protected function renderResponse($view, array $parameters = array(), Response $response = null)
    {
        return $this->get('templating')->renderResponse($view, $parameters, $response);
    }
941603
protected function render(Template $template)
    {
        $presenter = $this->createPresenter($template->getPresenter());

        try {
            $arguments = $this->getArguments($presenter, $template);
            $this->logger->debug($arguments);
            $result = call_user_func_array($presenter, $arguments);
        } catch(Exception $e) {
            if ($this->throwRenderExceptions) {
                throw $e;
            }

            $this->logger->error($e->getMessage() .
                    "\n\nURL: " . URLUtils::fullUrl() .
                    "\n\nTemplate:\n" . print_r($template, true) .
                    (isset($arguments) ? "\n\n$presenter args:\n" . print_r($arguments, true) : '')
                );

            $result = '';
        }

        return $result;
    }
80570
protected function render(IComponentResponse $response, IContext $context)
    {
        $content = $response->getContent();

        if ($content instanceof IDisplayModel) {
            $view = $this->getView();

            if ($view instanceof IContextAware) {
                $view->setContext($context);
            }

            try {
                $content = $view->render($content->getTemplate(), $content->getVariables());
            } catch (\Exception $e) {
                throw new RuntimeException(
                    $this->translate(
                        'Cannot render template "{template}".',
                        [
                            'template' => $content->getTemplate()
                        ]
                    ),
                    0,
                    $e
                );
            }

            $response->setContent($content);

            if ($view instanceof IContextAware) {
                $view->clearContext();
            }
        }

        return $response;
    }
280146
public function after($response)
	{
		// If nothing was returned default to the template
		if ($response === null)
		{
			$response = $this->template;
		}

		return parent::after($response);
	}
1245369
public function renderFromString(ResponseInterface $response, $templateString, array $data = array())
    {
        $this->view->loadString($templateString);
        $this->renderWithData($response, $data);
        return $response;
    }