84669 person learning
152542 person learning
20005 person learning
5487 person learning
7821 person learning
359900 person learning
3350 person learning
180660 person learning
48569 person learning
18603 person learning
40936 person learning
1549 person learning
1183 person learning
32909 person learning
一般用到smarty的时候都是 先assign、display,然后在一个模板页 .html里头是 section或foreach取出。。。链接的样子也是 .php?aid=XX &cid=XX 这样。如果生成静态页的话,google了一下都是用smarty的fetch函数。。。。。下面不知道怎么办了。。。。。
Some questions about smarty generating static pages? -PHP Chinese website Q&A-Some questions about smarty generating static pages? -PHP Chinese website Q&A
Let’s take a look and learn.
fetch获取html,直接保存为文件呀。[mw_shl_code=php,true]$smarty->assign("Name","Fred");//捕获输出$output = $smarty->fetch("index.tpl");//保存为静态文件file_put_contents("index.html", $output);[/mw_shl_code]
Some questions about smarty generating static pages? -PHP Chinese website Q&A-Some questions about smarty generating static pages? -PHP Chinese website Q&A
Let’s take a look and learn.
fetch获取html,直接保存为文件呀。
[mw_shl_code=php,true]$smarty->assign("Name","Fred");
//捕获输出
$output = $smarty->fetch("index.tpl");
//保存为静态文件
file_put_contents("index.html", $output);
[/mw_shl_code]