r56821 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r56820‎ | r56821 | r56822 >
Date:15:16, 23 September 2009
Author:simetrical
Status:ok
Tags:
Comment:
Improve $attribs documentation in Html

As suggested by Nikerabbit on code review for r56778, noted how boolean
attributes are handled in a function-level comment. Also adjusted
comments to reduce duplication by referring to other functions'
comments.
Modified paths:
  • /trunk/phase3/includes/Html.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/Html.php
@@ -99,8 +99,8 @@
100100 *
101101 * @param $element string The element's name, e.g., 'a'
102102 * @param $attribs array Associative array of attributes, e.g., array(
103 - * 'href' => 'http://www.mediawiki.org/' ). Values will be HTML-escaped.
104 - * A value of false means to omit the attribute.
 103+ * 'href' => 'http://www.mediawiki.org/' ). See expandAttributes() for
 104+ * further documentation.
105105 * @param $contents string The raw HTML contents of the element: *not*
106106 * escaped!
107107 * @return string Raw HTML
@@ -192,7 +192,8 @@
193193 *
194194 * @param $element string Name of the element, e.g., 'a'
195195 * @param $attribs array Associative array of attributes, e.g., array(
196 - * 'href' => 'http://www.mediawiki.org/' ).
 196+ * 'href' => 'http://www.mediawiki.org/' ). See expandAttributes() for
 197+ * further documentation.
197198 * @return array An array of attributes functionally identical to $attribs
198199 */
199200 private static function dropDefaults( $element, $attribs ) {
@@ -290,7 +291,9 @@
291292 *
292293 * @param $attribs array Associative array of attributes, e.g., array(
293294 * 'href' => 'http://www.mediawiki.org/' ). Values will be HTML-escaped.
294 - * A value of false means to omit the attribute.
 295+ * A value of false means to omit the attribute. For boolean attributes,
 296+ * you can omit the key, e.g., array( 'checked' ) instead of
 297+ * array( 'checked' => 'checked' ) or such.
295298 * @return string HTML fragment that goes between element name and '>'
296299 * (starting with a space if at least one attribute is output)
297300 */

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r56778Fix "Invalid argument for foreach()" in Html...simetrical17:41, 22 September 2009

Status & tagging log