Heim  >  Fragen und Antworten  >  Hauptteil

Thinkphp3.2.3 kann Variablen nicht mit der U-Methode in der HTML-Vorlage analysieren

Die URL wird korrekt generiert, aber die Variable nach dem Parametercode wird nicht analysiert.
Ich habe stattdessen samrty verwendet. Bitte helfen Sie mir

世界只因有你世界只因有你2679 Tage vor1363

Antworte allen(3)Ich werde antworten

  • 曾经蜡笔没有小新

    曾经蜡笔没有小新2017-05-27 17:46:04

    模板标签错了,需要加冒号,{:U(code)},另外,U里面使用的是单引号,所以无法直接解析变量,需要使用.拼接字符串!如: 'active='.$item[]

    Antwort
    0
  • 習慣沉默

    習慣沉默2017-05-27 17:46:04

    用这个试试:U('url',array('size'=>14,'thick'=>25,'code'=>$info['CardNo']),false)
    该方法有三个参数,详情请查阅TP文档

    Antwort
    0
  • 漂亮男人

    漂亮男人2017-05-27 17:46:04

    你的方式错了吧!url的访问模式。应该这样玩
    U('controller/action/size/14') 写死参数名和参数值
    U('controller/action/size/'.$info['size'].'/id/'.$info['id']) 变量值

    U('controller/action').'?id=12&size='.$info['size'] 如果要使用?方式。

    因为 U('controller/action') 就会生成 controller/action.html
    所以,应该把? 写在 U('')的外面

    Antwort
    0
  • StornierenAntwort