▸ Is your feature request related to a problem? Please describe.
There is no intuitive way to nest element and nest them safely. I can use one of following methods:
Html::el('ul')->addHtml(Html::el('li'))
- the problem is, that
addHtml()'s parameter accepts string as well which opens it for potential XSS issues
Html::el('ul')->create('li')
- safe one, but not much intuitive and requires a loop in case of nesting multiple elements into one parent
▸ Explain your intentions.
I suggest to create addChild(Html $child) and addChildren(Html[] $children) methods on Html objects. As it accepts only Html instances it is safe and its name also goes with industry standard.
▸ It's up to you to make a strong case to convince the project's developers of the merits of this feature.
I did above.
I can make a pull request if you agree on this proposal as well.
▸ Is your feature request related to a problem? Please describe.
There is no intuitive way to nest element and nest them safely. I can use one of following methods:
Html::el('ul')->addHtml(Html::el('li'))addHtml()'s parameter acceptsstringas well which opens it for potential XSS issuesHtml::el('ul')->create('li')▸ Explain your intentions.
I suggest to create
addChild(Html $child)andaddChildren(Html[] $children)methods onHtmlobjects. As it accepts onlyHtmlinstances it is safe and its name also goes with industry standard.▸ It's up to you to make a strong case to convince the project's developers of the merits of this feature.
I did above.
I can make a pull request if you agree on this proposal as well.