-
-
Notifications
You must be signed in to change notification settings - Fork 151
Open
Description
▸ 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 acceptsstringas well which opens it for potential XSS issues
- the problem is, that
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.
janpecha
Metadata
Metadata
Assignees
Labels
No labels