-
-
Notifications
You must be signed in to change notification settings - Fork 148
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Rename Html:add() to Html:addHtml() #111
Conversation
* Adds new element's child. | ||
* @param Html|string Html node or raw HTML string | ||
* @return self | ||
*/ | ||
public function add($child) | ||
public function addHtml($child) |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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.
Other places which may lead to confusion:
|
@@ -363,17 +363,39 @@ public function getText() | |||
|
|||
|
|||
/** | |||
* @deprecated | |||
*/ | |||
public function add($child) |
There was a problem hiding this comment.
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.
@JanTvrdik |
https://twitter.com/jakubvrana/status/733655999618404352