Adds the assets of the template to the Assets manager.

@param TemplateInterface $template

@return void
775228
protected function addTemplateAssets($template)
    {
        /** @var SplFileInfo $file_info */
        foreach ($template->getAssets() as $filename => $file_info) {
            $this->assets->set($filename, $file_info->getRelativePathname());
        }
    }
147988
protected function _setPlaceholderTemplate($template)
    {
        if (!is_null($template)) {
            $template = $this->_normalizeStringable($template);
        }

        $this->placeholderTemplate = $template;
    }
870614
protected function _addAction(&$text, TemplateInterface $template)
    {
        // All: Add the action if left empty
        if (preg_match_all('#<\s*form[^>]+action=""#si', $text, $matches, PREG_SET_ORDER))
        {
            foreach ($matches as $match)
            {
                $str  = str_replace('action=""', 'action="' . $template->route() . '"', $match[0]);
                $text = str_replace($match[0], $str, $text);
            }
        }

        return $this;
    }
520546
protected function addAssetsFromContainer(AssetCollection &$assetsCollection, $parameter)
    {
        if ( ! $this->container->hasParameter($parameter)) {
            return;
        }

        $assets = $this->container->getParameter($parameter);
        $assetsCollection->addRange($assets);
    }
385988
public function setTemplatePathAndFilename($templatePathAndFilename)
    {
        $this->baseRenderingContext->getTemplatePaths()->setTemplatePathAndFilename($templatePathAndFilename);

        $partialRootPaths = $this->baseRenderingContext->getTemplatePaths()->getPartialRootPaths();
        $layoutRootPaths = $this->baseRenderingContext->getTemplatePaths()->getLayoutRootPaths();
        array_unshift($partialRootPaths, Files::concatenatePaths([dirname($templatePathAndFilename), 'Partials']));
        array_unshift($layoutRootPaths, Files::concatenatePaths([dirname($templatePathAndFilename), 'Layouts']));
        $this->baseRenderingContext->getTemplatePaths()->setPartialRootPaths($partialRootPaths);
        $this->baseRenderingContext->getTemplatePaths()->setLayoutRootPaths($layoutRootPaths);
    }
1341561
public function onParseTemplate(Template $template): void
    {
        if (substr($template->getName(), 0, 4) !== 'nav_') {
            return;
        }

        $template->navClass = (string) $this->navClass;
    }
904864
public function setTemplateFileName($templateFileName)
    {
        if (!file_exists($this->getPathToTemplateFileName($templateFileName))) {
            throw new TemplateNotFoundException($templateFileName);
        }

        $this->templateFileName = $templateFileName;
    }
893976
protected function execute(InputInterface $input, OutputInterface $output)
    {
        $output->writeln('Available templates:');
        foreach ($this->factory->getAllNames() as $template_name) {
            $output->writeln('* '.$template_name);
        }
        $output->writeln('');
    }
1236474
public function parameterize(TemplateInterface $template)
    {
        $params = [];

        foreach ($template->getRequirements() as $key => $requirement) {
            if (!$this->input->hasOption($key) || !$this->input->getOption($key)) {
                list($prompt, $default) = $requirement;

                if ('description' === $key) {
                    $v = $this->style->ask($prompt.' (enter "e" to open editor)', $default);

                    if ('e' === $v) {
                        $editor = $this->getHelperSet()->get('editor');
                        $v = $editor->fromString('');
                    }
                } else {
                    if ('branch' === $key && $this->input->hasOption('base') && $this->input->getOption('base')) {
                        $default = $this->input->getOption('base');
                    }
                    if (1 < count($choices = explode('|', $default))) {
                        $v = $this->style->choice($prompt.' ', $choices, $choices[0]);
                    } else {
                        $v = $this->style->ask($prompt.' ', $default);
                    }
                }
            } else {
                $v = $this->input->getOption($key);
            }

            $params[$key] = $v;
        }

        $template->bind($params);
    }
174605
public function addAssetToCollectionAction(Asset $asset, AssetCollection $assetCollection): void
    {
        $success = false;
        if ($assetCollection->addAsset($asset)) {
            $this->assetCollectionRepository->update($assetCollection);
            $success = true;
        }
        $this->view->assign('value', $success);
    }
1253768
public function load(TemplateReferenceInterface $template)
    {
        foreach ($this->loaders as $loader) {
            if (false !== $storage = $loader->load($template)) {
                return $storage;
            }
        }

        return false;
    }
1282487
private function doRender(GridViewInterface $grid, $template, array $context = [])
    {
        $context['grid'] = $grid;

        return $this->twig->render($this->resolveTemplate($grid->getDefinition(), $template), $context);
    }
927184
protected function render($template, $args = array())
    {
        if (!is_null($this->renderTemplateSuffix)
            && !preg_match('/\.' . $this->renderTemplateSuffix . '$/', $template)
        ) {
            $template .= '.' . $this->renderTemplateSuffix;
        }
        $this->app->render($template, $args);
    }
543638
public function setTemplate($template)
    {
        $this->templatePath = $this->getTemplatesDirectory() . '/' . ltrim($template, '/');
        if (!file_exists($this->templatePath)) {
            throw new \RuntimeException('View cannot render template `' . $this->templatePath . '`. Template does not exist.');
        }
    }
328330
public function execute(\Template $template)
	{
		if(!Bootstrap::isEnabled())
		{
			return;
		}

		foreach($GLOBALS['BOOTSTRAP']['templates']['modifiers'] as $config)
		{
			if($config['disabled'] || !$this->isTemplateAffected($template->getName(), $config['templates']))
			{
				continue;
			}

			if($config['type'] == 'replace')
			{
				if(is_callable($config['replace']))
				{
					$value = call_user_func($config['replace'], $template);
				}
				else
				{
					$value = $config['replace'];
				}

				$template->$config['key'] = str_replace($config['search'], $value, $template->$config['key']);
			}
			elseif($config['type'] == 'callback')
			{
				call_user_func($config['callback'], $template);
			}
		}
	}
894354
public function startTemplate($__assetTemplateName, $__assetTemplateData = [])
    {
        if ($this->currentName) {
            throw new \LogicException('Do not support nested template for: ' . $__assetTemplateName . '. current template is: ' . $this->currentName);
        }

        $this->currentName = $__assetTemplateName;

        extract((array) $__assetTemplateData);

        ob_start();

        return $this;
    }
558471
public function include(string $template, array $variables = null): void
    {
        $renderer = new Renderer($this->resolve, $this->sections);
        echo $renderer->render($template, $variables);
    }