Set the name of the template to be used. Should not include file extension.

@param string $tpl
@param boolean $clearParams
@return void
19261
public function setTemplate($tpl, $clearParams=true)
    {
        if ($clearParams) {
            $this->clearParams();
        }
        $this->templateFile = $this->templatesPath.$tpl.'.tpl.php';
    }
667727
protected function tpl($template, array $values)
    {
        if((!isset($values['id']) || !$values['id']) && isset($values['name'])) {
            $values['id'] = sprintf('input-%s', $values['name']);
        }

        $buffer = $template;
        foreach($values as $key => $val) {
            $buffer = str_replace('{{' . $key . '}}', $val, $buffer);
        }
        
        // Cleaning up the remaining placeholders.
        $buffer = preg_replace('%\{\{[^}]*\}\}%', '', $buffer);
        
        return $buffer;
    }
786233
public function extend($template, $data = [], $paramName = 'body') {
		$this->extendedTemplate = $this->resolveTemplatePath($template);
		if (is_array($data)) {
			$this->extendedData = $data;
		}
		if (is_string($paramName) && $paramName) {
			$this->extendedParamName = $paramName;
		}
	}
10794
public function setTemplateMap(array $templateMap)
    {
        $this->templateMap = [];
        foreach ($templateMap as $name => $filename) {
            $this->addTemplate($name, $filename);
        }
    }
453813
public function setName($name)
	{
		$this->_name = $name;
		$this->setPath('template', $this->_basePath . '/views/' . $this->getName() . '/tmpl');

		return $this;
	}
1297234
public function display($tpl = '')
    {
        if (Container::get('request')->isCli()) {
            throw new ResponseException('cannot render template in CLI mode');
        }

        if ('' === $tpl) {
            $tpl = Container::get('route')->getController() . '/'
            . Container::get('route')->getAction();
        }

        $this->viewPath = $this->tplDir . $tpl . '.html';
        if (!Helper::isFile($this->viewPath)) {
            throw new NotFoundException('Template is not existed.');
        }

        unset($tpl);
        ob_start();
        extract($this->data, EXTR_OVERWRITE);
        include $this->viewPath;
        $buffer = ob_get_contents();
        ob_get_clean();
        $output = Helper::comment() . preg_replace('|</body>.*?</html>|is', '', $buffer, -1, $count) . Container::get('trace')->showTrace();
        if ($count > 0) {
            $output .= '</body></html>';
        }

        echo $output;
    }
418672
protected function renderTpl($tpl, $data = array())
    {
        if (!empty($tpl)) {
            extract($data);
            ob_start();
            eval('?>'.$tpl.'<?php ');
            $tpl = ob_get_clean();
        }

        return $tpl;
    }
775806
public boolean acceptTemplate(String tpl)
	{

		if (isInWhiteList(tpl) && !isInBlackList(tpl)) {
			if (containsAllowedPrefix(tpl) && !containsRestrictedPrefix(tpl)) {
				return true;
			}
			else {
				return false;
			}
		}
		else {
			return false;
		}

	}
159610
public function setTemplateFile(string $templateFile)
    {
        if (!$templateFile) {
            return $this;
        }
        $this->templateFile = (string) $templateFile;

        return $this;
    }
892476
public function display($tpl = '')
    {
        $tpl || $tpl = Url::pathInfo();

        if($this->layout){
            self::$content = $this->_getContent($tpl);
            $content = $this->_getContent($this->layout);
        }else
            $content = $this->_getContent($tpl);
        $this->addToken($content);
        headers_sent() || header('Content-Type: text/html; charset=utf-8');
        echo $content;
    }
408502
public function setTemplate( $layout_template )
	{
		$tpl_config = $this->config->getConfig( 'templates' );

		if ( !isset( $tpl_config[$layout_template] ) )
		{
			trigger_error( "Template file '$layout_template' not found." );
			return false;
		}

		$this->layout_template =  ROOT_PATH . '/'. $tpl_config[$layout_template];
	}
150461
public static function init() {
		self::$tpl_auto_config = Yesf::app()->getConfig('view.auto', Yesf::CONF_PROJECT) === true;
		self::$tpl_extension = Yesf::app()->getConfig('view.extension', Yesf::CONF_PROJECT, 'phtml');
		self::$tpl_engine = Template::class;
		Container::getInstance()->setMulti(Template::class, Container::MULTI_CLONE);
	}
358934
protected function initRuntimeVars(Dwoo_ITemplate $tpl)
	{
		$this->runtimePlugins = array();
		$this->scope =& $this->data;
		$this->scopeTree = array();
		$this->stack = array();
		$this->curBlock = null;
		$this->buffer = '';
	}
1262709
private function _setContentFromFile() {
		
		// empty original template content
		$this->setContent('');
		
		// check for template file and load it
		if ($filename = $this->getTemplate()) {
			if (file_exists($filename)) {
				$content = trim(file_get_contents($this->_filename));
				$this->setContent($content);
			}
		}
	}
1117666
public function includeFile($templateFilename) {

        /* @deprecated use $this when accessing assigned variables */

        $tpl = $this;

        eval('?>' .
            file_get_contents(Application::getInstance()->getRootPath() .
                (defined('TPL_PATH') ? str_replace('/', DIRECTORY_SEPARATOR, ltrim(TPL_PATH, '/')) : '') .
                $templateFilename
            ));

    }
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);
    }
217630
protected function sendHeaders($tmpFile)
    {
        header('Pragma: public');
        header('Expires: 0');
        header('Cache-Control: must-revalidate, post-check=0, pre-check=0');
        header('Content-Type: application/pdf');
        header('Content-Transfer-Encoding: binary');
        header('Content-Length: ' . filesize($tmpFile));
    }