This article introduces the method of using the Smarty template engine to generate static pages in PHP, as well as the implementation Code of the PHP implementation article pagination, which requires a friend's reference. example, PHP smarty generate static pages, in-article pagination code. Topic: PHP Pagination Code principle
', $content); $num = 0; foreach ($temp as $key = + $val) {$num + +; $pagenav = "; if ($key = = 0) {$file _name = '. /html/'. $article _id. HTML '; } else {$file _name = '. /html/'. $article _id. ' _'. ($key + 1). '. HTML '; } for ($i =1; $i <=count ($temp), $i + +) {if (($key + 1) = = $i) {$pagenav. = "{$i}"; } else {if ($i = = 1) {$pagenav = $pagenav. " {$i} "; } else {$pagenav. = "{$i}"; }}} $_post[' content ' = $val; $tpl->assign (' A ', $_post); $tpl->assign (' Pagenav ', $pagenav); $html = $tpl->fetch (' show_article.html '); $FP =fopen ($file _name, ' W '); if ($fp) {fwrite ($fp, $html); Fclose ($FP); }} alert ("Generate {$num} Chapter Success", ' add_article.php ');} else {alert (' Increase failed! ');}} else {//$FCK->value= ' Fanglor are a boy! '; $editer = $FCK->createhtml (); $tpl->assign (' Editer ', $editer); $tpl->display (' add_article.html ');}? > To generate a static page related article:
- Examples of using Smarty to generate static files in PHP
- Key code for generating static pages for the Smarty template engine
- PHP methods for generating static pages (three functions)
- Two ways to generate static files in PHP
- Smarty methods for generating static pages
article pagination related articles:
- PHP long article page code sharing
- PHP long article pagination implementation code
- PHP article pagination Implementation code
- PHP Text article pagination code example
- PHP implementation of long article page display code
|