Renders a template to a {@link String}.

@param templateName
@param model
555181
public String renderToString(String templateName, Map<String, Object> model) {
        if (templateEngine == null) {
            throw new PippoRuntimeException("You must set a template engine in your application");
        }

        // merge the model passed with the locals data
        model.putAll(getLocals());

        // add session (if exists) to model
        Session session = Session.get();
        if (session != null) {
            model.put("session", session);
        }

        // render the template using the merged model
        StringWriter stringWriter = new StringWriter();
        templateEngine.renderResource(templateName, model, stringWriter);

        return stringWriter.toString();
    }
427705
public String render(String template) {
    ENGINE_LOG.debug(template);
    return render(parse(template), true);
  }
999965
def get_templates(model):
    
    for template_name, template in templates.items():
        if issubclass(template.model, model):
            yield (template_name, template.layout._meta.verbose_name)
815255
def render(filename, context=binding)
      contents=File.read(expand_filename(filename))
      template(contents, context)
    end
648531
public void templateModem_name_DELETE(String name) throws IOException {
		String qPath = "/xdsl/templateModem/{name}";
		StringBuilder sb = path(qPath, name);
		exec(qPath, "DELETE", sb.toString(), null);
	}
87332
public Renderable<?> render(Template template, Map<String, Object> parameters) {
        return template.render(this, parameters);
    }
1357473
public static void renderTo(String template, Writer writer, Map<String, Object> paras)
	{
		Template t = gt.getTemplate(template);
		t.binding(paras);
		t.renderTo(writer);
	}
1192084
function(template, model, file) {
    var code = Mustache.render(template, model, templates)
      .replace(/[^\S\r\n]+$/gm, '');
    fs.writeFileSync(file, code, 'UTF-8');
    console.info('Wrote ' + file);
  }
829103
public Renderable<?> render(Template template, Object... parameters) {
        Map<String, Object> map = Maps.newHashMap();
        String key = null;
        for (Object parameter : parameters) {
            if (key == null) {
                if (!(parameter instanceof String)) {
                    throw new IllegalArgumentException("The template variable name " + parameter + " must be a string");
                } else {
                    key = (String) parameter;
                }
            } else {
                map.put(key, parameter);
                key = null;
            }
        }
        if (key != null) {
            throw new IllegalArgumentException("Illegal number of parameter, the variable " + key + " has no value");
        }
        return template.render(this, map);
    }
948496
def render_template(template_name, **context):
    """"""
    tmpl = jinja_env.get_template(template_name)
    context["url_for"] = url_for
    return Response(tmpl.render(context), mimetype="text/html")
1038704
function renderCustomTemplate(body, template, callback) {
  if(typeof callback !== 'function') {
    callback = function(){};
  }

  if(typeof template === 'function') {
    template(body, callback);
  }

  // if(typeof template === 'string') {

  // }
}
1074950
@Override
	protected void renderMergedTemplateModel(Map<String, Object> model, HttpServletRequest request,
			HttpServletResponse response) throws NoSuchBeanDefinitionException, NoUniqueBeanDefinitionException
	{
		// 如果未指定groupTemplate，取上下文中唯一的GroupTemplate对象
		if (groupTemplate == null)
		{
			groupTemplate = getApplicationContext().getBean(GroupTemplate.class);
		}

		// 渲染方法
		WebRender render = new WebRender(groupTemplate) {
			@Override
			protected void modifyTemplate(Template template, String key, HttpServletRequest request,
					HttpServletResponse response, Object... args)
			{
				Map<?, ?> model = (Map<?, ?>) args[0];

				for (Entry<?, ?> entry : model.entrySet())
				{
					String name = (String) entry.getKey();
					Object value = entry.getValue();
					template.binding(name, value);
				}
			}
		};
		String path = getUrl();
		render.render(path, request, response, model);
	}
728597
protected function render($viewName, $params = [])
    {
        $params['model'] = $this->model;
        return parent::render($viewName, $params);
    }
264408
function(templateName, options) {
        var template = this.templates[templateName];
        if (!template) {
            throw new Error('Unknown template: ' + templateName);
        }

        if (typeof template === 'function') {
            var templateResult = template(options);
            return typeof templateResult === 'string' ? templateResult.trim() : templateResult;
        } else if (template.render) {
            return template.render(options).trim();
        } else {
            return template.toString().trim();
        }
    }
1150592
def render_to_string(self, template_name, context=None):
        """"""
        # create an empty context if no context was specified
        context = context or {}
        tmpl = self.get_template(template_name)
        # render the template into a unicode string (None means unicode)
        return tmpl. \
            generate(**context). \
            render(self.output_type, encoding=None)
572071
public static String compile(String path, String templateName, Map<String, Object> input) {
		try {
			Template template = getConfig(path).getTemplate(templateName);
			StringWriter writer = new StringWriter();
			template.process(input, writer);
			return writer.toString();
		} catch (Exception e) {
			JK.throww(e);
			return null;
		}

	}
1116113
def render_template(view, template, layout_name, locals)
      path = template.identifier

      result = path.match(/(?<=\/)[a-zA-Z0-9_-]+(?=\/app\/views)/)
      result = result.to_s.split('-').first.to_s + '/engine'

      engine = result.classify.safe_constantize

      view.instance_variable_set(:@_rendered_from, engine.root) if engine

      super
    end