示例#1
0
文件: output.php 项目: a195474368/ejw
 public static function format($format = 'html', $charset = NULL)
 {
     global $_G;
     self::$charset = $charset = $charset ? strtolower($charset) : $_G['product']['charset'];
     self::$format = $format;
     //关闭缓冲
     //ob_end_clean();
     switch ($format) {
         case 'xml':
             header('Content-Type: text/xml; charset=' . $charset);
             break;
         case 'html':
             header('Content-type: text/html; charset=' . $charset);
             break;
         case 'json':
             header('Content-type: text/javascript; charset=' . $charset);
             break;
         case 'csv':
             header("Cache-Control: public");
             header("Content-type:application/msexcel; charset=" . $charset);
             header("Accept-Ranges: bytes");
             break;
         case 'attachment':
             header("Cache-Control: public");
             header("Content-type:application/octet-stream; charset=" . $charset);
             header("Accept-Ranges: bytes");
             break;
         default:
         case 'text':
             header('Content-Type: text/plain; charset=' . $charset);
             break;
     }
 }
示例#2
0
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<?php 
Output::charset();
?>
<title><?php 
Output::title();
?>
</title>
<?php 
Output::meta('author', 'caleng');
Output::keywords();
Output::description();
Output::importJS();
Output::importCSS();
?>
</head>

<body>
<?php 
include_once $TEMPLATE_FILE;
?>

</body>
</html>