Domanda

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

È stato utile?

Soluzione

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.

Altri suggerimenti

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.

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top