搜尋

首頁  >  問答  >  主體

thinkphp 5.1 模板中三元比較失效

<select name="tra_num">
        <option value="" {$num_tra=="%"?'selected':''}>全部</option>
{volist name="list_tra" id="arr_tra" empty="沒有文章"}
        <option value="{$arr_tra.id}" { {$num_tra} == {$arr_tra.id} ?' selected':''}>{$arr_tra.id}</option>
        {/volist}
      </select>

##這樣寫雙花號無效編號看是以下狀況

<select name="tra_num">


##<select name="tra_num">
        <option value="" >全部</option>
   (7 == 1 ?'selected':'')}>1</option>
               <option value="2" { (7 == 2 ?'selected':'')lt;option value="2" { (7 == 2 ?'selected':'')lt;option>}>> ;/option>
                <option value="4" { (7 == 4 ?'selected':'')}>4<mm " { ( 7 == 5 ?'selected':'')}>5</option>
               <option value="6" { (7 == 6 ?'selected':''}> /option>
                <option value="7" { (7 == 7 ?'selected':'')}>7<O;option>   </ div>

凡人凡人1826 天前1178

全部回覆(1)我來回復

  • 殘留の回憶

    殘留の回憶2019-12-05 18:53:07

    中文的{吧,還是你改了模板標籤了

    回覆
    0
  • 取消回覆