Override the default template
341020
function setTemplateFile($file){
		$this->_template->setTemplateFile(ROOT . DS . 'application' . DS . 'views' . DS . $file);
		
	}
1203605
def _handle_template(self, token):
        """"""
        params = []
        default = 1
        self._push()
        while self._tokens:
            token = self._tokens.pop()
            if isinstance(token, tokens.TemplateParamSeparator):
                if not params:
                    name = self._pop()
                param = self._handle_parameter(default)
                params.append(param)
                if not param.showkey:
                    default += 1
            elif isinstance(token, tokens.TemplateClose):
                if not params:
                    name = self._pop()
                return Template(name, params)
            else:
                self._write(self._handle_token(token))
        raise ParserError("_handle_template() missed a close token")
967548
function normalize(options, templates) {
  // Options override defaults and toc methods.
  var result = _.defaults({}, options, toc, toc.defaults);
  // Remove "core" methods from result object.
  ['defaults', 'process', 'anchorize', 'toc'].forEach(function(prop) {
    delete result[prop];
  });
  // Compile Lodash string templates into functions.
  (templates || []).forEach(function(tmpl) {
    if (typeof result[tmpl] === 'string') {
      result[tmpl] = _.template(result[tmpl]);
    }
  });
  return result;
}
306533
def resolve_template(template):
    ""
    if isinstance(template, (list, tuple)):
        return loader.select_template(template)
    elif isinstance(template, basestring):
        try:
            return loader.get_template(template)
        except TemplateDoesNotExist:
            return None
    else:
        return template
386871
def override(self, obj):
        """"""
        for field in obj.__class__.export_fields:
            setattr(self, field, getattr(obj, field))
226811
function defaultRenderer(template, data) {
    return template.replace(/%\w+/g, function (match) {
        return data[match.slice(1)];
    });
}
491529
def template(*args, **kwargs):
    '''
    
    '''
    tpl = args[0] if args else None
    template_adapter = kwargs.pop('template_adapter', SimpleTemplate)
    if tpl not in TEMPLATES or DEBUG:
        settings = kwargs.pop('template_settings', {})
        lookup = kwargs.pop('template_lookup', TEMPLATE_PATH)
        if isinstance(tpl, template_adapter):
            TEMPLATES[tpl] = tpl
            if settings: TEMPLATES[tpl].prepare(**settings)
        elif "\n" in tpl or "{" in tpl or "%" in tpl or '$' in tpl:
            TEMPLATES[tpl] = template_adapter(source=tpl, lookup=lookup, **settings)
        else:
            TEMPLATES[tpl] = template_adapter(name=tpl, lookup=lookup, **settings)
    if not TEMPLATES[tpl]:
        abort(500, 'Template (%s) not found' % tpl)
    for dictarg in args[1:]: kwargs.update(dictarg)
    return TEMPLATES[tpl].render(kwargs)
506185
private function setTemplate()
    {
        $this->template = $this->formHelper->getConfig($this->getTemplate(), $this->getTemplate());
    }
1115314
function (template, data) {
            var p;
            for (p in data) {
                if (data.hasOwnProperty(p)) {
                    template = template.replace(new RegExp('\\{\\{' + p + '\\}\\}', 'g'), data[p]);
                }
            }
            return template;
        }
236744
def enhance(self):
        
        self.update({'os_default_templates':
                     SubDict(self.api, self.objName,
                             self.payloadObj, self.key,
                             SubItemOsDefaultTemplate)})
        self.update({'config_templates':
                     SubDict(self.api, self.objName,
                             self.payloadObj, self.key,
                             SubItemConfigTemplate)})
        self.update({'ptables':
                     SubDict(self.api, self.objName,
                             self.payloadObj, self.key,
                             SubItemPTable)})
        self.update({'media':
                     SubDict(self.api, self.objName,
                             self.payloadObj, self.key,
                             SubItemMedia)})
        self.update({'architectures':
                     SubDict(self.api, self.objName,
                             self.payloadObj, self.key,
                             SubItemArchitecture)})
1125808
def render_template(self, template, **kwargs):
        
        kwargs["base_template"] = self.appbuilder.base_template
        kwargs["appbuilder"] = self.appbuilder
        return render_template(
            template, **dict(list(kwargs.items()) + list(self.extra_args.items()))
        )
1359066
private function handleTemplateSelection()
	{
		if (\Input::get('key') !== 'new_tpl') {
			return;
		}

		if (\Input::get('original') && !\Input::post('original')) {
			// Preselect the original template
			\Input::setPost('original', \Input::get('original'));
		}

		if (\Input::get('target') && !\Input::post('target')) {
			// Preselect the target template folder
			\Input::setPost('target', \Input::get('target'));
		}
	}
1010259
def init_config(self, app):
        """"""
        for k in dir(config):
            if k.startswith('OAUTHCLIENT_'):
                app.config.setdefault(k, getattr(config, k))

        @app.before_first_request
        def override_template_configuration():
            """Override template configuration."""
            template_key = app.config.get(
                'OAUTHCLIENT_TEMPLATE_KEY',
                'SECURITY_LOGIN_USER_TEMPLATE'  # default template key
            )
            if template_key is not None:
                template = app.config[template_key]  # keep the old value
                app.config['OAUTHCLIENT_LOGIN_USER_TEMPLATE_PARENT'] = template
                app.config[template_key] = app.config.get(
                    'OAUTHCLIENT_LOGIN_USER_TEMPLATE',
                    'invenio_oauthclient/login_user.html'
                )
532426
def _get_template(querystring_key, mapping):
    """"""
    default = None
    try:
        template_and_keys = mapping.items()
    except AttributeError:
        template_and_keys = mapping
    for template, key in template_and_keys:
        if key is None:
            key = PAGE_LABEL
            default = template
        if key == querystring_key:
            return template
    return default
72961
def render_default_template(workitem)

      workitem = workitem.to_h if workitem.respond_to?(:to_h)

      s = []
      s << "workitem for #{workitem['participant_name']}"
      s << ''
      s << Rufus::Json.pretty_encode(workitem['fei'])
      s << ''
      workitem['fields'].keys.sort.each do |key|
        s << " - '#{key}'  ==>  #{Rufus::Json.encode(workitem['fields'][key])}"
      end
      s.join("\n")
    end
381421
public function getDefaultTemplate() {
        if ($this->_defaultTemplate) return $this->_defaultTemplate;
 
		if ($this->template) {
			$path_parts = pathinfo($this->template);
			if ($path_parts['extension'] == 'php') {
				$app = Application::getInstance();
				if (file_exists( $app->getTemplatePath($this->template))) {
					$this->_defaultTemplate = $this->template;
				}
				else {
					$this->_defaultTemplate = $this->parent->getDefaultTemplate();
				}
			}
			else {
				$this->_defaultTemplate = $this->template;
			}
		}
		else {
			$this->_defaultTemplate = $this->parent->getDefaultTemplate();
		}

        return $this->_defaultTemplate;
    }
965754
def themed_default(self, cls, name, theme_overrides):
        ''' 

        '''
        overrides = theme_overrides
        if overrides is None or name not in overrides:
            overrides = cls._overridden_defaults()

        if name in overrides:
            default = self._copy_default(overrides[name])
        else:
            default = self._raw_default()
        return self.prepare_value(cls, name, default)