Open mvorisek opened 1 year ago
I don't see reason why to remove this class. Text is quite standard thing to do even if it can easily be done by using View.
I think set()
should not allow HTML and should probably use strip_tags
to clean it up.
And there should be setHtml()
method, in addition to addHtml()
which we already have, to allow developer to intentionally set html text there.
Also could think about moving addParagraph
functionality to separate class Paragraph extends Text
because of same reason - kind of simple View <p>
tag class, but could be useful in many cases so it's good to have some shortcut classes too.
one solution can be to rework every HTML string to be wrapped using HtmlTemplate\Value
, as this would imply a frequent imports, rename also the class to HtmlValue
Example:
Text
class should be probably removed completely in favor ofView
only.