質問

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