PHP smarty Template Easy to use method, Phpsmarty template
This article explains the simple use of PHP smarty templates. Share to everyone for your reference, as follows:
index.php:
Require ('.. /libs/smarty.class.php '); $smarty = new smarty;//Add a custom adjuster $smarty->registerplugin ("modifier", "E", " Htmlspecialchars "), $smarty->registerplugin (" modifier "," trim "," trim ");//$smarty->force_compile = true;$ Smarty->debugging = true; $smarty->caching = true; $smarty->cache_lifetime = 120;//definition identifier $smarty->left_ delimiter = ' {'; $smarty->right_delimiter = '} ';//Bind variable $smarty->assign ("test_html", "haha"); $smarty->display (' Index.tpl ');
INDEX.TPL:
{$test _html|e}
PostScript: How to get vs support for HTML editing of the TPL extension
Set in the menu [Tools > Options], such as:
More interested in PHP related content readers can view this site: "PHP Network Programming Skills Summary", "PHP Basic Grammar Introductory Tutorial", "PHP operation Office Document Skills Summary (including word,excel,access,ppt)", " PHP Date and Time usage summary, PHP Object-oriented Programming primer, PHP string usage Summary, PHP+MYSQL Database Operations Primer, and PHP Common database operations Tips Summary
I hope this article is helpful to you in PHP programming.
Articles you may be interested in:
- How to implement a multi-template website in PHP smarty
- PHP smarty Class Two classification code and template cycle examples
- PHP smarty Class Two classification code and template cycle examples
- PHP smarty template engine variable operators and how to use them
- Caching applications in the PHP smarty template engine
- Caching applications in the PHP smarty template engine
http://www.bkjia.com/PHPjc/1117058.html www.bkjia.com true http://www.bkjia.com/PHPjc/1117058.html techarticle PHP smarty Template Simple use method, Phpsmarty template This article describes the PHP smarty template simple use method. Share to everyone for your reference, as follows: Index.php:require ...