@param string $template

@return string|void
778777
public function setLayout( $template )
	{
		$template = str_replace( get_stylesheet_directory().'/templates/', '', $template );
		$this->template = UtilityFacade::trimRight( $template, '.php' );
		return $this->get( apply_filters( 'castor/templates/layout', 'layouts/default' ));
	}
363707
protected function compileTemplate($template)
	{
		$template = $this->normalizer->normalizeTemplate($template);

		// Parse the template
		$ir = TemplateParser::parse($template);

		// Serialize the representation to PHP
		$php = $this->serializer->serialize($ir->documentElement);
		if (isset($this->optimizer))
		{
			$php = $this->optimizer->optimize($php);
		}

		return $php;
	}
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);
			}
		}
	}
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);
    }
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);
    }
777744
private function pathForTemplate(string $template): string
    {
        $pathes = $this->resourceLoader->availableResourceUris('creator/' . $template);
        if (!isset($pathes[0])) {
            throw new \RuntimeException('Could not load template ' . $template);
        }

        return $pathes[0];
    }
1292625
protected function getTemplate($template)
    {
        $source = __DIR__.'/../../templates/'.$template;
        return file_exists($source) ? file_get_contents($source) : null;
    }
241229
public function setTemplate($template)
	{
		if (!($template instanceof Template))
		{
			$template = new Template($template);
		}

		$this->template = $template;
	}
171738
public function prepare(Template $template): void
    {
        $formLayout = $this->layoutManager->getDefaultLayout();

        if ($formLayout instanceof HorizontalFormLayout) {
            $template->labelColClass  = $formLayout->getLabelColumnClass();
            $template->colClass       = $formLayout->getColumnClass();
            $template->colOffsetClass = $formLayout->getColumnClass(true);
            $template->rowClass       = $formLayout->getRowClass();
            $template->isHorizontal   = true;
        } else {
            $template->labelColClass  = null;
            $template->colClass       = null;
            $template->colOffsetClass = null;
            $template->rowClass       = null;
            $template->isHorizontal   = false;
        }

        $template->formLayout  = $formLayout;
        $template->buttonClass = $this->getButtonClass();
    }
1333263
public function render($template = '')
    {
        $result = $template;
        if (is_array($template) || is_object($template)) {
            // Recursively go down into an object/array to tokenize.
            foreach ($result as &$val) {
                $val = $this->render($val);
            }
        } elseif (
            is_string($template)
            && strlen($template) >= self::TEMPLATE_MIN_LENGTH
            && false !== strpos($template, self::TOKEN_KEY_START)
            && false !== strpos($template, self::TOKEN_KEY_END)
        ) {
            if (isset($this->renderCache[$template])) {
                // Already tokenized this exact string.
                $result = $this->renderCache[$template];
            } else {
                // A new or non-tokenized string.
                $this->lastTemplate = $template;
                set_error_handler([$this, 'handleMustacheErrors'], E_WARNING | E_NOTICE);
                $result = $this->engine->render($template, $this->context);
                restore_error_handler();
                if (null !== $result && '' !== $result) {
                    // Store the result in cache for faster lookup later.
                    $this->renderCache[$template] = $result;
                }
            }
        }

        return $result;
    }
651709
public function template_include( $template ) {

		if ( '.twig' === substr( $template, - 5 ) ) {
			/** @var \Twig_Environment $twig */
			$twig = $this['twig.environment'];

			echo $twig->render( basename( $template ), apply_filters( 'meadow_context', array() ) );

			die();
		}

		return $template;
	}
279556
public function setTemplate($template)
    {
        $updateTemplateStm = $this->connection->prepare("UPDATE Page SET template = :template WHERE page_id = :page_id");
        $updateTemplateStm->bindParam(":template", $this->template);
        $updateTemplateStm->bindParam(":page_id", $this->page_id);
        $this->template = $template;
        $updateTemplateStm->execute();
    }
183875
public function setTemplate($template)
    {
        if(!$template instanceof TemplateInterface)
        {
            if(empty($template) || (is_string($template) && strpos($template, '.') === false) )
            {
                $identifier         = $this->getIdentifier()->toArray();
                $identifier['path'] = array('template');
                $identifier['name'] = $template;

                $identifier = $this->getIdentifier($identifier);
            }
            else $identifier = $this->getIdentifier($template);

            $template = $identifier;
        }

        $this->__template = $template;

        return $this->__template;
    }
137925
protected function solveTemplatePath($template) {
		foreach(array_reverse($this->templatePathSolvers) as $s) {
			if(($r = $s($this, $template)) && file_exists($r))
				return $r;
		}
	}
1194961
public static function ignore($template)
    {
        // calculate Uid if not already done
        if ($template->source->uid == '') {
            $template->source->filepath;
        }
        self::$ignore_uid[$template->source->uid] = true;
    }
1204678
public function getTemplateRelativePath($template)
	{
	    $rootPath = Config::getRootPath();
	    return str_replace($rootPath, '', $this->getTemplatePath()) . $this->_getRelativeTemplate($template) . $this->getSuffix();
	}
660184
protected function iteratePaths($template): \Generator
    {
        foreach ($this->paths as $path) {
            yield sprintf('%s/%s', rtrim($path, '/'), ltrim($template, '/'));
        }
    }