PHP的写法:<?php
$qx=array(1,2,3,4);
?><input type="checkbox" value="1" <?php if(in_array(1,$qx)){?>checked="checked"<?php }?>/>
<input type="checkbox" value="3" <?php if(in_array(3,$qx)){?>checked="checked"<?php }?>/>
<input type="checkbox" value="5" <?php if(in_array(4,$qx)){?>checked="checked"<?php }?>/>
<input type="checkbox" value="6" <?php if(in_array(6,$qx)){?>checked="checked"<?php }?>/>====================================================================================================
Smarty的写法:$qx=array(1,2,3,4);
$Smarty->assign('qx',$qx);
$Smarty->display('XXX.html');
请问在SMARTY里,input表单里该怎么写啊``
$qx=array(1,2,3,4);
?><input type="checkbox" value="1" <?php if(in_array(1,$qx)){?>checked="checked"<?php }?>/>
<input type="checkbox" value="3" <?php if(in_array(3,$qx)){?>checked="checked"<?php }?>/>
<input type="checkbox" value="5" <?php if(in_array(4,$qx)){?>checked="checked"<?php }?>/>
<input type="checkbox" value="6" <?php if(in_array(6,$qx)){?>checked="checked"<?php }?>/>====================================================================================================
Smarty的写法:$qx=array(1,2,3,4);
$Smarty->assign('qx',$qx);
$Smarty->display('XXX.html');
请问在SMARTY里,input表单里该怎么写啊``
$selected=array(1,2,3,4);
$Smarty->assign('selected',$selected); $qx=array(1,3,5,6);
$Smarty->assign('qx',$qx); $Smarty->display('XXX.html'); {html_checkboxes name="test" options=$qx selected=$selected separator="<br />"}
<?php
$qx=array(1,2,3,4);
if(in_array(1,$qx)){
其他代码(比如TABLE)
}
?>那这种样的 SMARTY该怎么写呢```