21,887
社区成员
发帖
与我相关
我的任务
分享
function index()
{
ob_start();
$this ->_executeView("view_index.html",$this ->_get_Data());
$cons= ob_get_contents();
ob_end_clean();
$objectPage='Index.html';
$fp=fopen($objectPage,"wb") or die("静态生成时打开文件".$objectPage."时出错");
fwrite($fp,$cons); #把HTML代码写入静态文件中!
fclose($fp);
}
function _get_Data()
{
$t = time();
return $t;
}
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>无标题文档</title>
<style>
</style>
<script>
</script>
</head>
<body>
<!--<body onload="load()">-->
现在是{$a|date_format:"%H"}时{$a|date_format:"%M"}分{$a|date_format:"%S"}秒
<div>
ddddddddddddddd
</div>
</body>
</html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>无标题文档</title>
<style>
body{font-size:14px; color:#FF0000;}
</style>
<script>
function load()
{
alert(111);
}
</script>
</head>
<body>
<!--<body onload="load()">-->
现在是{$a|date_format:"%H"}时{$a|date_format:"%M"}分{$a|date_format:"%S"}秒
<div>
ddddddddddddddd
</div>
</body>
</html>