Render the output of a template to a zone

eg.	add('before:content', 'template-name')
169811
public function addTemplateTo($zone, $template, Array $params=array()){
		if(!isset($this->content[$zone]))
			$this->content[$zone] = array();
		$this->content[$zone][] = array('type'=>'template', 'template'=>$template, 'params'=>$params);
	}
221796
def render_to_response(self, template_name, __data,
                           content_type="text/html"):
        ''''''
        resp = self.render(template_name, __data)
        return Response(resp,
                        content_type=content_type)
861882
def render_template_file(template, context=None):
    
    assert isinstance(context, Mapping)
    template = get_template(template)
    return template.render(context)
1227955
def render_to_string(self, request, template, context, content_instance=None):
        
        if not content_instance:
            content_instance = PluginContext(request)

        content_instance.update(context)
        return render_to_string(template, content_instance.flatten(), request=request)
735528
def render_content(content, **kwargs):
    ''''''
    # try to take pre rendered content from django cache, if caching is enabled
    if settings.ACTIVE_URL_CACHE:
        cache_key = get_cache_key(content, **kwargs)

        # get cached content from django cache backend
        from_cache = cache.get(cache_key)

        # return pre rendered content if it exist in cache
        if from_cache is not None:
            return from_cache

    # render content with "active" logic
    content = check_content(content, **kwargs)

    # write rendered content to django cache backend, if caching is enabled
    if settings.ACTIVE_URL_CACHE:
        cache.set(cache_key, content, settings.ACTIVE_URL_CACHE_TIMEOUT)

    return content
490849
def render_to_string(self, *args, **kwargs):
        """"""
        try:
            template_name, args = args[0], args[1:]
        except IndexError:
            raise TypeError('name of template required')
        return self.get_template(template_name).render(*args, **kwargs)
863080
def render_template(template_in, file_out, context):
    
    renderer = pystache.Renderer()
    result = renderer.render_path(template_in, context)
    with open(file_out, 'w') as handle:
        LOGGER.info('Rendering: {} to {}'.format(template_in, file_out))
        handle.write(result)
    shutil.copymode(template_in, file_out)
260420
def render_template(env, html_path, template_filename, context):
    
    template = env.get_template(template_filename)
    rendered_html = template.render(**context)  # pylint: disable=no-member
    html_path.write_text(rendered_html, encoding='utf-8')
289546
function render(template, data, block) {
  data = Benchpress.addGlobals(data || {});

  return Promise.try(() => {
    Benchpress.cache[template] = Benchpress.cache[template] || load(template);
    return Benchpress.cache[template];
  }).then((templateFunction) => {
    if (block) {
      templateFunction = templateFunction.blocks && templateFunction.blocks[block];
    }
    if (!templateFunction) {
      return '';
    }

    return runtime(Benchpress.helpers, data, templateFunction);
  });
}
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)
815255
def render(filename, context=binding)
      contents=File.read(expand_filename(filename))
      template(contents, context)
    end
937605
protected function renderZone($zone, $args=array()){
    $sep = isset($args['seperator']) ? $args['seperator'] : ' ';

		if($this->debug===true){
      echo "\n\n".'<!-- Template Zone: '.$zone.' -->';
    }

    $content = '';
    if(isset($this->content[$zone])){
      foreach($this->content[$zone] as $item){
        switch($item['type']){
          case 'hook':
            //method will be called with two arrays as arguments
            //the first is the args passed to this method (ie. in a template call to $this->insert() )
            //the second are the args passed when the hook was bound
            $content .= call_user_func_array($item['hook'], array($args, $item['arguments']));
            break;
          case 'html':
            $content .= $sep . (string) $item['html'];
            break;
          case 'template':
            $content .= $this->renderTemplate($item['template'], $item['params']);
            break;
          case 'zone':
            $content .= $this->renderZone($item['zone'], $item['params']);
            break;
        }

      }
    }
    //content from #movetoskin and #skintemplate
    if( \Skinny::hasContent($zone) ){
      foreach(\Skinny::getContent($zone) as $item){

        //pre-rendered html from #movetoskin
        if(isset($item['html'])){
          if($this->debug===true){
            $content.='<!--Skinny:MoveToSkin: '.$template.'-->';
          }
          $content .= $sep . $item['html'];
        }
        else
        //a template name to render
        if(isset($item['template'])){
          if($this->debug===true){
            $content.='<!--Skinny:Template (via #skintemplate): '.$item['template'].'-->';
          }
          $content .= $this->renderTemplate( $item['template'], $item['params'] );
        }
      }
    }
    return $content;
  }
398271
function renderTemplate(engine, filePath, content, context) {
    context = context || {};

    // Mutable objects to contains all blocks requiring post-processing
    var blocks = {};

    // Create nunjucks environment
    var env = engine.toNunjucks(blocks);

    // Replace shortcuts from plugin's blocks
    content = replaceShortcuts(engine.getBlocks(), filePath, content);

    return timing.measure(
        'template.render',

        Promise.nfcall(
            env.renderString.bind(env),
            content,
            context,
            {
                path: filePath
            }
        )
        .then(function(content) {
            return TemplateOutput.create(content, blocks);
        })
    );
}
290820
def render_content(self):
        """"""
        if not self.has_content:
            return ""
        template = self.template
        if isinstance(self.template, str):
            template = self.app.ps.jinja2.env.get_template(self.template)
        context = self.render_vars()
        content = template.render(app=self.app, request=self.request, **context)
        return content
523635
def render(template, dest, **kwargs):
    '''
    '''

    template = environment.get_template(template)
    text = template.render(**kwargs)

    f = open(dest, 'wb')
    f.write(text.encode('utf-8'))
    f.close()
314630
def render(request, template_name, context=None, content_type=None, status=None, using=None, logs=None):
    
    if logs:
        obj_logger = ObjectLogger()
        if not isinstance(logs, list):
            logs = [logs, ]
        for log in logs:
            log = obj_logger.log_response(
                log,
                context,
                status=str(status),
                headers='',
                content_type=str(content_type))
            log.save()
    return django_render(
        request,
        template_name,
        context=context,
        content_type=content_type,
        status=status,
        using=using)
692631
async function render(nj, templ, templateVars) {
  debug('templ before: ', templ);
  // if no vars passed, use
  // template itself as source of variables:
  if (_.isUndefined(templateVars))
    templateVars = JSON.parse(_.cloneDeep(templ));

  templ = await nj.renderStringAsync(templ, templateVars);
  if (templ.match(/\{\{.*\}\}/)) {
    // recurse
    return await render(nj, templ, templateVars);
  }
  return templ;
}