Closed
Description
The cookbook suggests to use DataTransformer to strip_tags
from input.
Isn't that violation of "Transforms a value between different representations"?
I mean, when u strip tags, it's not that representation of data changes – it's the data itself that gets changed. Stripping tags is a losing data procedure.
A cleaner way would be to use form event listener to change the data.
The example is almost right to use DataTransformer to change '<br>'
s to "\n"
and vice versa – almost, because the input could have both '<br>'
s and "\n"
– the original information, which should be where, would be lost as well.