phpzend-frameworknl2brzend-filter

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


Solution

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