There was no time to use Smarty to achieve the table color alternating display, will use jquery to do, but now the words with smarty, to implement this style is very simple, Smarty provides a function:Cycle. The following is the instance code:
The result of the final implementation is as follows:
Test.php>>>
Include_once ("smarty_inc.php");
$arr =array (a,b,c,d,e,f);
$smarty->assign (arr, $arr);
$smarty->display ("Test.tpl");
?>
Test.tpl>>>
{section name=a loop= $arr}
{Cycle values= "#eeeeee, #55eero"} ">
{$arr [a]}
|
{/section}
The above is the code, easy to use.
http://www.bkjia.com/PHPjc/478829.html www.bkjia.com true http://www.bkjia.com/PHPjc/478829.html techarticle There was no time to use Smarty to achieve the table color alternating display, will use jquery to do, but now the words with the smarty, to achieve this style is very simple, Smarty provides a function: ...