Event handler method - should not be called manually
@internal
@param  Template
@param  string
553909
public function onLoadComponentTemplate(Template $template, $fileName)
	{
		if (!$this->activeTheme) {
			return;
		}

		$path = $this->activeTheme->getPath() . 'templates' . DIRECTORY_SEPARATOR . 'components' . DIRECTORY_SEPARATOR . $fileName;
		if (file_exists($path)) {
			$template->setFile($path);
		} elseif ($parent = $this->activeTheme->getParent()) {
			$parentTheme = $this->getTheme($parent);
			$path = $parentTheme->getPath() . 'templates' . DIRECTORY_SEPARATOR . 'components' . DIRECTORY_SEPARATOR . $fileName;
			if (file_exists($path)) {
				$template->setFile($path);
			}
		}
	}
1139603
public void setTemplate(String template) throws MissingIncludeException {
	PageSource ps = pageContext.getCurrentPageSource().getRealPage(template);
	if (!ps.exists()) throw new MissingIncludeException(ps);
	errorPage.setTemplate(ps);
    }
856273
static void capturePageEvent(String eventName, final EventHandler handler) {
    HtmlPlatform.captureEvent(eventName, new EventHandler() {
      @Override
      public void handleEvent(NativeEvent evt) {
        handler.handleEvent(evt);
      }
    });
  }
1077616
public static void selfRender(XWPFTemplate template) {
		ObjectUtils.requireNonNull(template, "Template is null, should be setted first.");
		List<ElementTemplate> elementTemplates = template.getElementTemplates();
		if (null == elementTemplates || elementTemplates.isEmpty())
			return;
		RenderPolicy policy = null;
		for (ElementTemplate runTemplate : elementTemplates) {
			LOGGER.debug("Start self-render TemplateName:{}, Sign:{}", runTemplate.getTagName(), runTemplate.getSign());
			policy = template.getConfig().getDefaultPolicys().get(Character.valueOf('\0'));
			policy.render(runTemplate, new TextRenderData(runTemplate.getSource()), template);
		}
	}
1341561
public function onParseTemplate(Template $template): void
    {
        if (substr($template->getName(), 0, 4) !== 'nav_') {
            return;
        }

        $template->navClass = (string) $this->navClass;
    }
599843
public static function start_render($template)
    {
        $key = self::get_key($template);
        self::$template_data[$key]['start_time'] = microtime(true);
    }
250652
public static function end_render($template)
    {
        $key = self::get_key($template);
        self::$template_data[$key]['render_time'] += microtime(true) - self::$template_data[$key]['start_time'];
    }
386986
function(template) {
      // ensure template is decorated (lets' things like <tr template ...> work)
      HTMLTemplateElement.decorate(template);
      // ensure a default bindingDelegate
      var syntax = this.syntax || (!template.bindingDelegate &&
          this.element.syntax);
      var dom = template.createInstance(this, syntax);
      var observers = dom.bindings_;
      for (var i = 0; i < observers.length; i++) {
        this.registerObserver(observers[i]);
      }
      return dom;
    }
1217467
public function renderWithoutActionButton($template)
    {
        $custom = $this->customise([
            "Actions" => "",
        ]);

        if (is_string($template)) {
            $template = new SSViewer($template);
        }

        return $template->process($custom);
    }
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;
		}
	}
100559
public function send($template = false) {
    if ($template !== false) {
      $this->setContent(new Content($template));
    }
      
    $this->renderer->render($template);
  }
62638
public function onRender(ViewInterface $view, $template, array $context)
    {
        $this->assertView($view);
        
        $twig = $view->getTwig();
        
        $loader = $this->createFormulaLoader($twig);
        
        $assetManager = $this->createAssetManager($loader);
        $assetManager->setLoader('twig', $loader);   

        $tmpl = $twig->loadTemplate($template);
        
        do {
            $name = (string)$tmpl;
            $resource = $this->createResource($twig, $name);
            $assetManager->addResource($resource, 'twig');
        } while ($tmpl = $tmpl->getParent($context));
        
        $this->writer->writeManagerAssets($assetManager);
    }
73817
public function setTemplate($template)
    {
        if (is_string($template)) {
            $template = new TemplateView($template);
        }
        $template->mergeData([
            'layout' => $this
        ]);
        $this->addChild(new Part($template, 'template'));
        return $this;
    }
738766
private function _renderTemplate($template, $vars)
	{
		extract($vars, EXTR_SKIP);
		ob_start();

		try
		{
			require($template);
			$contents = ob_get_contents();
		}
		catch (Exception $e)
		{
			// TODO: come up with a clever way of chaining exceptions
			ob_end_clean();
			throw $e;
		}

		ob_end_clean();
		return $contents;
	}
1313107
public static function update_template($template) {

        $params = self::validate_parameters(self::update_template_parameters(), array('template' => $template));
        $params = $params['template'];
        $template = api::read_template($params['id']);
        self::validate_context($template->get_context());

        $params = (object) $params;

        return api::update_template($params);
    }
540188
public function template($template, $data = [])
    {
        $templatePath = self::$instance->app->findTemplate($template);
        echo self::$instance->renderTemplate($templatePath, $data);
    }
542782
public function postTemplate(Page $page, Template $template)
    {
        $this->authorize('editTemplate', $page);

        $page->setTemplate($template);

        Event::fire(new Events\PageTemplateWasChanged($page, $template));

        return $page->getCurrentVersion()->getStatus();
    }