Home >php教程 >php手册 >利用smarty生成静态页实例

利用smarty生成静态页实例

WBOY
WBOYOriginal
2016-06-07 11:43:04938browse

利用smarty生成静态页实例.

生成页面在根目录.

更多技术文章请移步
http://www.dahuzhi.com
class IndexAction extends GlobalAction {<br>     <br>     public function html()<br>     {<br>         $this->assign('title', '测试静态页标题');<br>         $this->assign('body', '测试静态页内容');<br>         //捕获输出赋值到变量<br>         $output = $this->fetch();<br>         //生成文件<br>         file_put_contents(APP_PATH . '/test.html', $output);<br>     }<br> }html模版页面<br> <br> <title>{$title}</title> <br> <br> <br> {$body}<br> <br>

AD:真正免费,域名+虚机+企业邮箱=0元

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn