smarty 问题

meilisheng 2006-11-10 03:49:35
要让下拉框中显示:“请选择”
大家怎么做的呢?有没有在模板中直接显示的呢?

我是inde.php

$tt[] = "请选择";
$query=...;
while($row = $db->fetch_array($query)){
$tt[] = $row[game];
}
$smarty->assign('cust_names',$tt);
$smarty->display('index.tpl');


index.tpl
<select name="customer_id" id="customer_id">
{ html_options values=$cust_ids selected=$customer_id output=$cust_names }
</select>
...全文
158 3 打赏 收藏 转发到动态 举报
写回复
用AI写文章
3 条回复
切换为时间正序
请发表友善的回复…
发表回复
jy_1201 2006-11-10
  • 打赏
  • 举报
回复
我也是这样做的。
meilisheng 2006-11-10
  • 打赏
  • 举报
回复
好,谢谢了
懒得去死 2006-11-10
  • 打赏
  • 举报
回复
只有楼主那样的

21,887

社区成员

发帖
与我相关
我的任务
社区描述
从PHP安装配置,PHP入门,PHP基础到PHP应用
社区管理员
  • 基础编程社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧