execute all registered template modifiers

@param \Template $template
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);
			}
		}
	}
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;
    }
99681
public function indexAction(Template $template)
    {
        $templating = $this->container->get('templating');

        $response = $this->getResponse(
            $templating->render(
                $template->getRenderName(),
                $template->getRenderData()
            )
        );

        return($response);
    }
660184
protected function iteratePaths($template): \Generator
    {
        foreach ($this->paths as $path) {
            yield sprintf('%s/%s', rtrim($path, '/'), ltrim($template, '/'));
        }
    }
1358594
public function addTemplate(Template $template)
    {
        $key = $this->normalizeKey($template->getTemplateName());
        $this->templates[$key] = $template;
    }
438034
public function addTemplates($templates)
    {
        foreach ($templates as $name => $template) {
            $this->twig->getLoader()->setTemplate($name, $template);
        }
    }
867438
public function setContent($template)
	{
		$this->inspector    = null;
		$this->template     = (string) $template;
		$this->isNormalized = false;
	}
481633
public function load($template)
    {
        $template = $this->findFirstExistingTemplate($template);
        if (!isset($this->loadedTemplates[ $template ])) {
            $class = $this->getTemplateClassName($template);

            $this->loadedTemplates[ $template ] = new $class($this);
            if (!$this->loadedTemplates[ $template ] instanceof Template) {
                throw new TemplatingException("The compiled class for {$template} is invalid");
            }
        }

        return $this->loadedTemplates[ $template ];
    }
1072005
private function templates(array $templates)
    {
        if ($templates) {
            foreach ($templates as $template) {
                if ($template->getManaged()) {
                    yield $template;
                }
            }

            return;
        }

        foreach ($this->templateManager->findAll() as $template) {
            if ($template->getManaged()) {
                yield $template;
            }
        }
    }
977605
public function template($template = null)
    {
        if (is_null($template)) {
            return $this->template;
        } else {
            $this->template = $template;
        }
    }
909764
protected function invokePluginsOnRender($template, array $context)
    {
        foreach ($this->plugins as $plugin) {
            $plugin->onRender($this, $template, $context);
        }
    }
86510
public static function start_compile($template)
    {
        static $_is_stringy = array('string' => true, 'eval' => true);
        if (!empty($template->compiler->trace_uid)) {
            $key = $template->compiler->trace_uid;
            if (!isset(self::$template_data[$key])) {
                if (isset($_is_stringy[$template->source->type])) {
                    self::$template_data[$key]['name'] = '\'' . substr($template->source->name, 0, 25) . '...\'';
                } else {
                    self::$template_data[$key]['name'] = $template->source->filepath;
                }
                self::$template_data[$key]['compile_time'] = 0;
                self::$template_data[$key]['render_time'] = 0;
                self::$template_data[$key]['cache_time'] = 0;
            }
        } else {
            if (isset(self::$ignore_uid[$template->source->uid])) {
                return;
            }
            $key = self::get_key($template);
        }
        self::$template_data[$key]['start_time'] = microtime(true);
    }
1090648
public function display(string $template)
    {
        if ($this->context && is_callable([$this->context, 'end'])) {
            $this->context->end($this->fetch($template));
        } else {
            echo $this->fetch($template);
        }
    }
899961
protected function renderTemplate($template)
    {
        // Build allowed extensions
        $allowedExtensions = new ArrayList();
        foreach (File::getAllowedExtensions() as $extension) {
            if ($extension) {
                $allowedExtensions->push(new ArrayData([
                    'Extension' => preg_quote($extension)
                ]));
            }
        }

        Config::nest();
        Config::modify()->set(SSViewer::class, 'source_file_comments', false);

        $viewer = SSViewer::create([$template]);
        $result = (string)$viewer->process(new ArrayData([
            'AllowedExtensions' => $allowedExtensions
        ]));

        Config::unnest();

        return $result;
    }
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('');
    }
970754
public function compile(Template $template)
    {
        // Otherwise, we look for a compile method
        $method = 'compile'.ucfirst($template->getName());
        if (!method_exists($this, $method)) {
            return null;
        }

        return $this->$method($template);
    }
15538
public function onSetupTemplate(Template $template)
	{
		if (!$this->activeTheme) {
			return;
		}
		$template->theme = $this->activeTheme;
		$template->themeDir = $template->basePath . '/' . $this->activeTheme->getRelativePath();
	}