Does Zend Framework have a nl2br filter? I can't see it - am I just missing it?

I imagine I could do the same thing with PregReplace...

有帮助吗?

解决方案

When we have an existing PHP function nl2br it really begs the question: "do we really need to wrap a ZF filter class around a function?"

There are a few filters that actually do that.

In terms of forms for injecting a filter (and maybe other cases) I would say yes or when we need some more flexibility with additional options; basically extending the PHP function. I don't really see a need for this particular function and you should be fine to simply use PHP out of the box.

其他提示

No, Zend Framework dos't have nl2br filter. If you want to use it then you should put it in your code where you want.

You can use any other methods also similar to that for achieving this.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top