Set template
@param  string           $template
@throws RuntimeException If template file does not exist

DEPRECATION WARNING!
This method will be removed in the near future.
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.');
        }
    }
20858
public function setContents($contents, $name, $prefix = '')
    {
        $path = $this->rootDir . '/' . $this->getFilename($name, $prefix);

        if (!is_file($path))
        {
            throw new RuntimeException('Template not exists: ' . $path);
        }

        @file_put_contents($path, $contents);
    }
341020
function setTemplateFile($file){
		$this->_template->setTemplateFile(ROOT . DS . 'application' . DS . 'views' . DS . $file);
		
	}
448964
public void setTemplate( String template )
    {
        if ( template == null || template.length() == 0 )
        {
            throw new IllegalStateException( "Template cannot be null or empty." );
        }

        if ( template.equals( _template ) )
        {
            return;
        }

        _template = template;
        _isParsed = false;
        _parsedTemplate = null;
    }
496611
public Context setTemplate(Template template) {
        checkThread();
        if (template != null) {
            setEngine(template.getEngine());
        }
        this.template = template;
        return this;
    }
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];
    }
25270
public function setMacroTemplateGroupFilter($filter, $macroTemplate = null)
    {
        if(!isset($this->groupFilters[$filter])){
            throw new \RuntimeException(sprintf("The group filter %s is not added.", $filter));
        }

        $groupFilter = $this->groupFilters[$filter];
        $groupFilter->setMacroTemplate($macroTemplate);
    }
810240
public function addTemplate(AlTemplate $template)
    {
        $key = $this->normalizeKey($template->getTemplateName());
        $this->templates[$key] = $template;
    }
355022
public function setTemplate($template)
    {
        if (!$this->id) {
            $this->getContentRoute()->setClassType(get_class($this));
            $this->getContentRoute()->setLocale($this->getLocale());
        }
        $this->getContentRoute()->setTemplate($template);

        return $this;
    }
741013
public function setTemplate($template)
    {
        if (empty($template)) {
            $this->template = null;
            return $this;
        }

        if (!is_string($template)) {
            throw new InvalidArgumentException(
                'Handler view template must be a string identifier.'
            );
        }

        $this->template = $template;
        return $this;
    }
926662
protected function templateExists($template)
    {
        try {
            $class = $this->templating->getTemplateClass($template);
        } catch (Twig_Error_Loader $e) {
            return false;
        }

        return $template;
    }
1267944
public function selectTemplate($template)
    {
        if (is_null($template)) {
            return 'default';
        }

        if (!array_key_exists($template, $this->templates)) {
            throw new RuntimeException("Template \"{$template}\" is not registered");
        }

        return $template;
    }
1292160
protected function templateExists($template)
    {
        $loader = $this->twig->getLoader();
        if ($loader instanceof ExistsLoaderInterface) {
            return $loader->exists($template);
        }

        try {
            if ($loader instanceof SourceContextLoaderInterface || method_exists($loader, 'getSourceContext')) {
                $loader->getSourceContext($template);
            } else {
                $loader->getSource($template);
            }

            return true;
        } catch (LoaderError $e) {
        }

        return false;
    }
15538
public function onSetupTemplate(Template $template)
	{
		if (!$this->activeTheme) {
			return;
		}
		$template->theme = $this->activeTheme;
		$template->themeDir = $template->basePath . '/' . $this->activeTheme->getRelativePath();
	}
1272045
public static function start_compile($template)
    {
        $key = self::get_key($template);
        self::$template_data[$key]['start_time'] = microtime(true);
    }
931171
public function setTemplate($template)
    {
        $this->template = is_string($template) ? trim($template) : $template;

        return $this;
    }
589477
public function createFromTemplate($template)
    {
        $parameter = new GroupParameter();
        $parameter->setName($template->name);
        $parameter->setTemplate($template);
        if ($template->type == GroupParameterType::HASHTABLE && isset($template->entries)) {
            $parameter->setChildren($this->createRequiredFromTemplates($template->entries));
        } elseif ($template->type != GroupParameterType::HASHTABLE && $template->type != GroupParameterType::EDITABLE_HASHTABLE) {
            if ($template->type == GroupParameterType::BOOLEAN) {
                $value = true;
            } else {
                $value = empty($template->values) ? '' : $template->values[0];
            }
            $parameter->addValue($value);
        }
        return $parameter;
    }