Skip to content

Commit

Permalink
more clear docs about html options
Browse files Browse the repository at this point in the history
  • Loading branch information
cebe committed Jan 28, 2014
1 parent f9dee9c commit 296fc72
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
7 changes: 5 additions & 2 deletions framework/helpers/BaseHtml.php
Original file line number Diff line number Diff line change
Expand Up @@ -113,9 +113,12 @@ public static function decode($content)
* @param string $name the tag name
* @param string $content the content to be enclosed between the start and end tags. It will not be HTML-encoded.
* If this is coming from end users, you should consider [[encode()]] it to prevent XSS attacks.
* @param array $options the tag options in terms of name-value pairs. These will be rendered as
* the attributes of the resulting tag. The values will be HTML-encoded using [[encode()]].
* @param array $options the HTML tag attributes (HTML options) in terms of name-value pairs.
* These will be rendered as the attributes of the resulting tag. The values will be HTML-encoded using [[encode()]].
* If a value is null, the corresponding attribute will not be rendered.
*
* For example when using `['class' => 'my-class', 'target' => '_blank', 'value' => null]` it will result in the
* html attributes rendered like this: `class="my-class" target="_blank"`.
* @return string the generated HTML tag
* @see beginTag()
* @see endTag()
Expand Down
4 changes: 4 additions & 0 deletions framework/helpers/Html.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@
/**
* Html provides a set of static methods for generating commonly used HTML tags.
*
* Nearly all of the methods in this class allow setting additional html attributes for the html
* tags they generate. You can specify for example. 'class', 'style' or 'id' for an html element
* using the `$options` parameter. See the documentation of the [[tag()]] method for more details.
*
* @author Qiang Xue <[email protected]>
* @since 2.0
*/
Expand Down

0 comments on commit 296fc72

Please sign in to comment.