Symfony/propel:propel 模式中文本中的新行,如何?
我有这个:
SediI18n:
XXXXXX: { id: sede_foo_1, culture: it, paese_indirizzo: it,
ufficio: "Ufficio di XXX 1", indirizzo: "Foo Bar FooBar" }
现在,当我打印此寄存器时,注册字段“indirizzo”:
FooBarFooBar
一切都在一条线上。
有什么方法可以写出“indirizzo”的值直接在我的网页上打印 页面像下面这样?
Foo
Bar
FooBar
哈维
I have this:
SediI18n:
XXXXXX: { id: sede_foo_1, culture: it, paese_indirizzo: it,
ufficio: "Ufficio di XXX 1", indirizzo: "Foo Bar FooBar" }
Now, when i prints this register the field "indirizzo":
Foo Bar FooBar
Everything is in one line.
Any way to write the value of "indirizzo" to print directly in my web
page something like this below?
Foo
Bar
FooBar
Javi
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可以尝试在字符串中嵌入
\n
,然后查看它们是否会进入数据库。您还可以通过以|
块文字 > 字符,它允许您跨越多行,但这可能会破坏生成的插入子句。然后,要将换行符转换为
标记,请使用nl2br()
当您显示字符串时,否则 HTML 源中的换行符将被忽略。You could try embedding
\n
in your string, and see whether they make it into the database. You could also try block literals by starting the string with a|
character, which allows you to span multiple lines, but that might break the generated insert clause.Then, to convert your newlines to
<br/>
tags, usenl2br()
when you display the string, otherwise the linebreaks in the HTML source will just be ignored.