【www.gdgbn.com--smarty模板】

smarty html_options 设置默认select 选值


index.php:

require("Smarty.php.class");
$smarty = new Smarty;
$smarty->assign("cust_options", array(
   1001 => "Joe Schmoe",
   1002 => "Jack Smith",
   1003 => "Jane Johnson",
   1004 => "Charlie Brown"));
$smarty->assign("customer_id", 1001);
$smarty->display("index.tpl");

index.tpl:


OUTPUT: (both examples)

本文来源:http://www.gdgbn.com/jiaocheng/22594/