smarty html_options 设置默认select 选值

作者:袖梨 2022-07-02

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)

相关文章

精彩推荐