The example of this article tells the PHP Smarty template simple use method. Share to everyone for your reference, specific as follows:
index.php:
Require ('.. /libs/smarty.class.php ');
$smarty = new Smarty;
Add 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 =;
Defines the identifier
$smarty->left_delimiter = ' {';
$smarty->right_delimiter = '} ';
Binding variable
$smarty->assign ("test_html", "<a>haha</a>");
$smarty->display (' Index.tpl ');
INDEX.TPL:
PostScript: How to allow HTML edits of the VS support TPL extension
In the menu [Tools > Options], set the following figure:
More interested in PHP related content readers can view the site topics: "PHP Network Programming Skills Summary", "PHP basic Grammar Introductory Course", "PHP operation Office Document Skills Summary (including word,excel,access,ppt)", " PHP Date and Time usage summary, PHP Introduction to object-oriented Programming, PHP String (String) Usage summary, PHP+MYSQL database Operations Tutorial and PHP Common database operating Skills summary
I hope this article will help you with the PHP program design.