Set the current template.

@param template - current template
496611
public Context setTemplate(Template template) {
        checkThread();
        if (template != null) {
            setEngine(template.getEngine());
        }
        this.template = template;
        return this;
    }
1270040
public function onParseTemplate(Template $template): void
    {
        if (strpos($template->getName(), 'fe_') !== 0) {
            return;
        }

        $template->bootstrapEnvironment = $this->environment;
    }
864593
public function setLayout($template) {
		$layout = $this->getTemplatePathname($template);
		if(!is_file($layout)) {
			throw new \RuntimeException("Layout file `$template` does not exist.");
		} else {
			$this->layout = $template;
		}
	}
875692
public void setTuneAndTemplate(Tune tune, ScoreTemplate template) {
		//from setTemplate(template)
		if (m_template != null)
			m_template.removeListener(this);
		m_template = template;
		m_template.setGraphics(getGraphics2D());
		m_template.addListener(this);
		//from refresh()
		initGfx();
		setTune(tune);
	}
538443
public function setTemplate($template, $body = null)
    {
        $this->template = $template;

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

        return '';
    }
1064431
public void addTemplate( String templateName, URLTemplate template )
    {
        if ( templateName == null || templateName.length() == 0 )
        {
            throw new IllegalArgumentException( "Template name cannot be null or empty." );
        }

        if ( template == null )
        {
            throw new IllegalArgumentException( "URLTemplate cannot be null." );
        }

        _templates.put( templateName, template );
    }
796148
public void updatedTemplate(Bundle bundle, File templateFile) {
        ThymeLeafTemplateImplementation template = getTemplateByFile(templateFile);
        if (template != null) {
            LOGGER.debug("Thymeleaf template updated for {} ({})", templateFile.getAbsoluteFile(), template.fullName());
            updatedTemplate();
        } else {
            try {
                addTemplate(bundle, templateFile.toURI().toURL());
            } catch (MalformedURLException e) { //NOSONAR
                // Ignored.
            }
        }
    }
647050
public function setTemplates(array $templates) {

        if ($templates !== null && is_array($templates)) {
            $this->_userChangedTemplates = array_merge(array_keys($templates), $this->_userChangedTemplates);
        }

        $this->_setTemplatesWrapper($templates);
    }
458271
public static StringTemplate stringTemplate(String template, Object... args) {
        return stringTemplate(createTemplate(template), ImmutableList.copyOf(args));
    }
68924
def setMenuTemplate( self, template ):
        
        try:
            xtree = ElementTree.fromstring(nativestring(template))
        except ExpatError, e:
            logger.exception(e)
            return
        
        self.uiMenuTREE.setUpdatesEnabled(False)
        self.uiMenuTREE.blockSignals(True)
        
        self.uiMenuTREE.clear()
        for xaction in xtree:
            self.uiMenuTREE.addTopLevelItem(self.loadXml(xaction))
        
        self.uiMenuTREE.setUpdatesEnabled(True)
        self.uiMenuTREE.blockSignals(False)
357260
public function setTemplate()
    {
        // Creates the loader & sets the template directory path
        $loader = new FilesystemLoader('../src/View');

        // Creates the template engine
        $twig = new Environment($loader, array(
            'cache' => false,
            'debug' => true
        ));

        // Adds Twig extensions
        $twig->addExtension(new DebugExtension());
        $twig->addExtension(new PamTwigExtension());

        // Attributes the template engine to the current object
        $this->twig = $twig;
    }
929371
public void registerTemplate(String name, ITemplate template) {
        if (null == template) throw new NullPointerException();
//        if (_templates.containsKey(name)) {
//            return false;
//        }
        _templates.put(name, template);
        return;
    }
350334
public void setTemplate(ElemTemplate v)
  {

    if (null == m_templates)
      m_templates = new Vector();

    m_templates.addElement(v);
    v.setStylesheet(this);
  }
1234197
function setElementTemplate($html, $element = null)
    {
        if (is_null($element)) {
            $this->_elementTemplate = $html;
        } else {
            $this->_templates[$element] = $html;
        }
    }
1115954
protected function _setTemplate($template)
    {
        if ($template !== null && !($template instanceof TemplateInterface)) {
            throw $this->_createInvalidArgumentException($this->__('Invalid template'), null, null, $template);
        }

        $this->template = $template;
    }
342909
public void setTemplateRule(TemplateRule templateRule) {
        this.templateRule = templateRule;
        if (templateRule != null) {
            if (this.transformType == null) {
                setTransformType(TransformType.TEXT);
            }
            if (templateRule.getEncoding() != null && this.encoding == null) {
                this.encoding = templateRule.getEncoding();
            }
        }
    }
677752
public function set_template($template)
	{
		// make sure the template is a View
		if (is_string($template))
		{
			$this->template = $this->view($template);
		}
		else
		{
			$this->template = $template;
		}

		// return the template view for chaining
		return $this->template;
	}