Sets the template object

@param TemplateInterface $template
@return $this
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;
    }
1358594
public function addTemplate(Template $template)
    {
        $key = $this->normalizeKey($template->getTemplateName());
        $this->templates[$key] = $template;
    }
241229
public function setTemplate($template)
	{
		if (!($template instanceof Template))
		{
			$template = new Template($template);
		}

		$this->template = $template;
	}
403436
public function prepare(ContentInterface $content, ThemeInterface $theme, $templateTypeName = null)
    {
        $this->contextStack->push(
            $this->contextBuilder
                ->setContent($content)
                ->setTheme($theme)
                ->setTemplateTypeName($templateTypeName)
            ->createContext()
        );

        return $this;
    }
2366
public function setTemplate($type, $template)
    {
        if (!is_callable($template)) {
            $template = (string) $template;
        }

        $this->templates[$type] = $template;
    }
261561
public function templatesLoader(TemplateLoaderInterface $value = null)
    {
        if (null === $value) {
            return $this->templatesLoader;
        }
        $this->templatesLoader = $value;
        foreach ($this->commands as $name => $command) {
            $command->templatesLoader = $value;
        }
        return $this;
    }
1111041
public static function create(Template $template): self
    {
        $renderTemplateDirective = new self();

        $renderTemplateDirective->type     = self::TYPE;
        $renderTemplateDirective->template = $template;

        return $renderTemplateDirective;
    }
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();
    }
1232439
public function setCurrentTemplateEngine(string $id) {
		Container::getInstance()->setMulti($id, Container::MULTI_CLONE);
		$clazz = Container::getInstance()->get($id);
		if (!is_subclass_of($clazz, __NAMESPACE__ . '\\TemplateInterface')) {
			throw new InvalidClassException("$clazz not implemented TemplateInterface");
		}
		$this->tpl_engine_obj = $clazz;
	}
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;
		}
	}
986697
public function registerTemplate(TemplateInterface $template)
    {
        $templateName = $template->getName();
        $parts = explode('/', $templateName);

        if (count($parts) !== 2) {
            throw new \InvalidArgumentException(
                sprintf(
                    'Template name "%s" is not formatted properly, should be like "domain/template-name"',
                    $templateName
                )
            );
        }

        list($domain, $name) = $parts;

        $this->templates[$domain][$name] = $template;
    }
359930
public function setSakonninTemplate(\BisonLab\SakonninBundle\Entity\SakonninTemplate $sakonninTemplate = null)
    {
        $this->sakonnin_template = $sakonninTemplate;

        return $this;
    }
962650
public function load(TemplateReferenceInterface $template)
    {
        $file = $template->get('name');

        if (self::isAbsolutePath($file) && is_file($file)) {
            return new FileStorage($file);
        }

        $replacements = [];
        foreach ($template->all() as $key => $value) {
            $replacements['%'.$key.'%'] = $value;
        }

        $fileFailures = [];
        foreach ($this->templatePathPatterns as $templatePathPattern) {
            if (is_file($file = strtr($templatePathPattern, $replacements)) && is_readable($file)) {
                if (null !== $this->logger) {
                    $this->logger->debug('Loaded template file.', ['file' => $file]);
                }

                return new FileStorage($file);
            }

            if (null !== $this->logger) {
                $fileFailures[] = $file;
            }
        }

        // only log failures if no template could be loaded at all
        foreach ($fileFailures as $file) {
            if (null !== $this->logger) {
                $this->logger->debug('Failed loading template file.', ['file' => $file]);
            }
        }

        return false;
    }
1250130
protected static function initializeColumns(\Template $template)
	{
		$layout = Bootstrap::getLayout();

		switch($layout->cols)
		{
			case '2cll':
				$template->leftClass           = $layout->bootstrap_leftClass;
				$template->mainClass           = $layout->bootstrap_mainClass;

				$template->mainClassAttribute  = sprintf(static::$classAttribute, $layout->bootstrap_mainClass);
				$template->leftClassAttribute  = sprintf(static::$classAttribute, $layout->bootstrap_leftClass);
				break;

			case '2clr':
				$template->rightClass          = $layout->bootstrap_rightClass;
				$template->mainClass           = $layout->bootstrap_mainClass;

				$template->mainClassAttribute  = sprintf(static::$classAttribute, $layout->bootstrap_mainClass);
				$template->rightClassAttribute = sprintf(static::$classAttribute, $layout->bootstrap_rightClass);
				break;

			case '3cl':
				$template->leftClass           = $layout->bootstrap_leftClass;
				$template->rightClass          = $layout->bootstrap_rightClass;
				$template->mainClass           = $layout->bootstrap_mainClass;

				$template->mainClassAttribute  = sprintf(static::$classAttribute, $layout->bootstrap_mainClass);
				$template->rightClassAttribute = sprintf(static::$classAttribute, $layout->bootstrap_rightClass);
				$template->leftClassAttribute  = sprintf(static::$classAttribute, $layout->bootstrap_leftClass);
				break;

			default:
				$template->useGrid = false;
				return;
		}

		$template->useGrid = true;
	}
569913
public function setTemplate($template, $field = null)
    {
        if ($field === null) {
            $field = $this->last_column;
        }

        /** @type GiTemplate $gi */
        $gi = $this->add('GiTemplate');
        $this->columns[$field]['template'] = $gi->loadTemplateFromString($template);

        return $this;
    }
502839
public function refresh(ThemeSlotsInterface $themeSlots, Template $template = null, PageBlocksInterface $pageBlocks = null)
    {
        $this->themeSlots = $themeSlots;
        $this->template = $template;
        $this->pageBlocks = $pageBlocks;

        $this->setUpSlotManagers();

        return $this;
    }
999167
public function bind (array $data) : TemplateInterface
    {
        $this->data = array_merge($this->data, $data);
        return $this;
    }