ThinkPHP-如何在option中使用if语句

<select name="area">
<volist name="area" id="l">
<option value="{$l.id}" <if condition="$vo.areaid eq $l['id']">selected</if>>{$l.title}</option>
</volist>
</select>

注意写法: 在if中,{$l.id} 要写成 $l[‘id’]

affiliate_link
Share this Post:
Digg Google Bookmarks reddit Mixx StumbleUpon Technorati Yahoo! Buzz DesignFloat Delicious BlinkList Furl

One Response to “ThinkPHP-如何在option中使用if语句”

Leave a Reply:

Name (required):
Mail (will not be published) (required):
Website:
Comment (required):
XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>