Skip to content

Conversation

@JanTvrdik
Copy link
Contributor

* @param Html|string Html node or raw HTML string
* @return self
*/
public function add($child)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe only allow Html instance?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure that's a good idea. How would you provide custom HTML as string?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You would need to wrap it as an Html instance. But I think that the current solution is better.

@JanTvrdik
Copy link
Contributor Author

Other places which may lead to confusion:

  • $el->insert – maybe not used by anyone directly
  • $el[] – likely used by somebody, don't know how to solve except for deprecating the entire ArrayAccess implementation


/**
* @deprecated
*/
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like how is the add() short. What about to allow HTML instance and strings consider as a text? Not sure how to warn about change.

@castamir
Copy link

@JanTvrdik
$el->insert() might became protected or should at least be annotated as @internal
$el[] is a shortcut for adding child elements, isn't it? We can modify array access setter to use addHtml()... or we can deprecate this feature if noone actually use it :D

@dg dg merged commit 1e58e66 into nette:master Jun 17, 2016
dg pushed a commit to nette/forms that referenced this pull request Jun 17, 2016
dg pushed a commit that referenced this pull request Jun 17, 2016
dg pushed a commit that referenced this pull request Jun 17, 2016
dg pushed a commit that referenced this pull request Jun 17, 2016
dg pushed a commit to nette/forms that referenced this pull request Jun 17, 2016
@JanTvrdik JanTvrdik deleted the pr/html_add branch June 19, 2016 08:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants