模板显示 调用内置的模板引擎显示方法，
@access protected
@param string $templateFile 指定要调用的模板文件
默认为空 由系统自动定位模板文件
@param string $charset 输出编码
@param string $contentType 输出类型
@param string $content 输出内容
@param string $prefix 模板缓存前缀
@return void
482332
protected function display($templateFile='',$charset='',$contentType='',$content='',$prefix='') {
        $this->view->display($templateFile,$charset,$contentType,$content,$prefix);
    }
1071365
public function render(string $templateFile = '')
    {
        if ($templateFile) {
            $this->setTemplateFile($templateFile);
        }

        $this->initRender();


        try {
            ob_start();
            include $this->getTemplateFile();
            $this->content = ob_get_clean();
        } catch (\Exception $e) {
            ob_end_clean();
            throw new ViewException($e->getMessage(), $e->getCode());
        }

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

        return $this;
    }
700525
public function addContent(string $content, string $contentType, ?string $charset = null): Message
    {
        $charset = $charset ?: $this->getCharset();

        $this->content[] = [
            'content'      => $content,
            'content_type' => $contentType,
            'charset'      => $charset
        ];

        return $this;
    }
1281681
public function apply(&$templateString) {

		$this->encoding = strtoupper(Application::getInstance()->getConfig()->site->default_encoding);

		$templateString = preg_replace_callback(
			'~(^|\s|>|(?:<a [^>]*?>.*?))'.Rex::URI_STRICT.'(<|\s|$)~i',
			array($this, 'urlAnchors'),
			$templateString
		);

		$templateString = preg_replace_callback(
			'~(<a [^>]*?>.*?|)('.Rex::EMAIL.')([^<]*</a>|)~i',
			array($this, 'obfuscatedMailAnchors'),
			$templateString
		);

	}
1111639
public function getPageUsingTemplate($templatefile)
    {
        $pages = $this->getPagesUsingTemplate($templatefile);

        return count($pages) ? $pages[0] : null;
    }
389512
private void setContentType(String contentType) {
        // The content type may contain the charset, parse it and set it.
        if (contentType != null && contentType.contains("charset=")) {
            charset = Charset.forName(contentType.substring(contentType.indexOf("charset=") + 8).trim());
        }
        headers.put(HeaderNames.CONTENT_TYPE, contentType);
    }
794172
public function contentType($contentType, $charset = 'utf-8') {

        $this->contentType = $contentType;
        $this->charset = $charset;
        return $this;
    }
1006650
private static function encodeBoundaryBlock($boundary, $contentType, $charset, $encoding, $content, $eol = "\n") {
		return '--' . $boundary . $eol
			. 'Content-Type: ' . $contentType. '; charset="' . $charset . '"' . $eol
			. 'Content-Transfer-Encoding: ' . $encoding . $eol . $eol 
			. self::encodeString($content, $encoding, $eol)
			. $eol . $eol;
	}
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);
    }
200042
public function contentType(string $content_type, string $charset = '')
    {
        $header = new ContentType($content_type);

        if (!empty($charset)) {
            $header->setCharset($charset);
        }

        $this->addHeader($header);
    }
732036
public function apply(&$templateString) {

		$application	= Application::getInstance();
		$config			= $application->getConfig();

		$locale = $application->getCurrentLocale();

		// without locale replace placeholders with their identifier

		if(empty($locale)) {

			$templateString = preg_replace(
				array(
					'@\{![a-z0-9_]+\}@i',
					'@\{![a-z0-9_]+:(.*?)\}@i'
				),
				array(
					'',
					'$1'
				),
				$templateString
			);
			return;

		}

		$this->getPhrases($locale);

		$templateString = preg_replace_callback(
			'@\{!([a-z0-9_]+)(:(.*?))?\}@i',
			array($this, 'translatePhraseCallback'),
			$templateString
		);
	}
915512
public function setContentType($contentType)
    {
        if (is_bool(strpos($contentType, 'charset=')) && $this->charset) {
            $contentType .= '; charset=' . $this->charset;
        }
        
        $this->headers['Content-Type'] = $contentType;
        return $this;
    }
58328
public function writeCachedContent(Smarty_Internal_Template $_template, $content)
    {
        if (Smarty_Internal_Write_File::writeFile($_template->cached->filepath, $content, $_template->smarty) === true) {
            $_template->cached->timestamp = filemtime($_template->cached->filepath);
            $_template->cached->exists = !!$_template->cached->timestamp;
            return true;
        }
        return false;
    }
1286991
public function setType(string $contentType, ?string $charset = null): Response
	{
		$this->contentType = $contentType;

		if($charset !== null)
		{
			$this->charset = $charset;
		}

		return $this;
	}
389796
public function writeCachedContent(Smarty_Template_Cached $cached, Smarty_Internal_Template $_template, $content)
    {
        if ($_template->source->handler->recompiled || !($_template->caching == Smarty::CACHING_LIFETIME_CURRENT ||
                $_template->caching == Smarty::CACHING_LIFETIME_SAVED)
        ) {
            // don't write cache file
            return false;
        }
        $content = $_template->smarty->ext->_codeFrame->create($_template, $content, '', true);
        return $this->write($cached, $_template, $content);
    }
516957
public function display($templateFile = '', $inOtherApp = false)
    {
        // 网页字符编码
        header('Content-Type:text/html; charset=' . Config::get('default_charset'));
        echo $this->fetch($templateFile, $inOtherApp);
        Cml::cmlStop();
    }