Action::display PHP Method

display() protected method

模板显示 调用内置的模板引擎显示方法
protected display ( string $templateFile = '', string $charset = 'utf-8', string $contentType = 'text/html' ) : voi
$templateFile string 指定要调用的模板文件 默认为空 由系统自动定位模板文件
$charset string 输出编码
$contentType string 输出类
return voi
    protected function display($templateFile = '', $charset = 'utf-8', $contentType = 'text/html')
    {
        echo $this->fetch($templateFile, $charset, $contentType);
    }

Usage Example

コード例 #1
0
 /**
 +----------------------------------------------------------
 * 模板显示
 * 重写父类display方法
 +----------------------------------------------------------
 * @access protected
 +----------------------------------------------------------
 * @param string $templateFile 指定要调用的模板文件
 * 默认为空 由系统自动定位模板文件
 * @param string $charset 输出编码
 * @param string $contentType 输出类型
 +----------------------------------------------------------
 * @return void
 +----------------------------------------------------------
 */
 protected function display($templateFile = '', $charset = '', $contentType = 'text/html')
 {
     if ($this->_CFG['open_gzip'] && extension_loaded('zlib') && strstr($_SERVER['HTTP_ACCEPT_ENCODING'], 'gzip')) {
         ini_set('zlib.output_compression', 'On');
         ini_set('zlib.output_compression_level', 3);
         ob_start('ob_gzhandler');
         parent::display($templateFile, $charset, $contentType);
         ob_end_flush();
     } else {
         parent::display($templateFile, $charset, $contentType);
     }
 }
All Usage Examples Of Action::display