Home >Backend Development >PHP Tutorial >Examples of usage of smarty template conditional judgment in php_PHP tutorial
Template file test6.html code:
3 4
5
16 17
18
|
|
1 2 3 4 5 6 7 | <🎜>require 'libs/Smarty.class.php'; //Contains Smarty class library files<🎜> <🎜>$smarty = new Smarty; //Create a new Smarty object<🎜> <🎜>$cond = 1;<🎜> <🎜>$smarty->assign("cond",$cond); //Assign values to variables in the template $smarty->display('test6.htm'); //Display page ?> |