r76173 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r76172‎ | r76173 | r76174 >
Date:00:09, 6 November 2010
Author:tparscal
Status:deferred
Tags:
Comment:
Comments and formatting
Modified paths:
  • /trunk/extensions/HtmlUi/classes/HtmlUiTemplate.php (modified) (history)

Diff [purge]

Index: trunk/extensions/HtmlUi/classes/HtmlUiTemplate.php
@@ -8,12 +8,18 @@
99 * By convention only display logic should be written into templates files and use of the global
1010 * statement should not be allowed.
1111 *
 12+ * While some support functions are provided for rendering portions of XML syntax such as attributes
 13+ * or escaping/unescaping, this class intentionally does not contain functions for generating tags
 14+ * themseleves. In cases where generating tags seems like it's needed, consider creating a new
 15+ * template and passing the rendered contents of that template into another.
 16+ *
1217 * @author Trevor Parscal <tparscal@wikimedia.org>
1318 */
1419 class HtmlUiTemplate {
1520
1621 /* Protected Members */
1722
 23+ /** String: Path to template file */
1824 protected $filePath;
1925
2026 /* Methods */
@@ -80,12 +86,14 @@
8187 }
8288
8389 /**
84 - * Renders XML attributes from an array of key and value pairs. If a value is an array, it's
85 - * imploded using a space as a delimiter. If any attributes are rendered, the result is preceded
86 - * with a single space, otherwise the result is an empty string. Keys will be escaped (but
87 - * should have never had any escapable characters in them anyways) and values are assumed to be
88 - * escaped already (since data given to the template is escaped by default).
 90+ * Renders XML attributes from an array of key and value pairs.
8991 *
 92+ * If a value is an array, it's imploded using a space as a delimiter. If any attributes are
 93+ * rendered, the result is preceded with a single space, otherwise the result is an empty
 94+ * string. Keys will be escaped (but should have never had any escapable characters in them
 95+ * anyways) and values are assumed to be escaped already (since data given to the template is
 96+ * escaped by default).
 97+ *
9098 * @param $data Mixed: Data to make into attributes, string or array of strings or an array of
9199 * attribute/value pairs where a value can either be a string or an array and will be
92100 * imploded with a space delimiter.

Status & tagging log