DatsunBing
DatsunBing

Reputation: 9076

Does ZF have a filter for nl2br?

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...

Upvotes: 1

Views: 630

Answers (2)

Adrian World
Adrian World

Reputation: 3128

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.

Upvotes: 2

user2334807
user2334807

Reputation:

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.

Upvotes: 0

Related Questions