【问题标题】:Twig doesn't show String with blank spacesTwig 不显示带有空格的字符串
【发布时间】:2018-04-16 11:35:39
【问题描述】:

我对 Twig 有疑问。

我有一个对象,它包含一个类型为字符串的属性。字符串包含一些空格“”,(例如“Prueba Primera”),但在树枝视图中,当我显示文本时,视图仅显示“Prueba”,字符串的其他部分没有显示。 这是我在 php 中的对象:

$informe->setTitulo("Prueba Primera");

这是我在 twig 中的代码:

<input type = "text" name = "titulo"  id = "titulo" class = "texto"   value = {{informe.titulo}} disabled/>

只有树枝显示:“Prueba”

【问题讨论】:

  • 在浏览器中打开 HTML 源代码并查看树枝显示。
  • 浏览器中的 HTML 源代码显示此问题:
  • @CristianGomez。什么问题?您的问题表明它仅显示“Prueba”但未出现在该 html 中?

标签: php html symfony twig


【解决方案1】:

像这样在树枝值周围添加"

value="{{informe.titulo}}"

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2015-06-02
    • 2015-07-05
    • 1970-01-01
    • 1970-01-01
    • 2017-03-27
    • 1970-01-01
    • 1970-01-01
    • 2015-04-04
    相关资源
    最近更新 更多