Index: trunk/extensions/HtmlUi/classes/HtmlUiTemplate.php |
— | — | @@ -8,12 +8,18 @@ |
9 | 9 | * By convention only display logic should be written into templates files and use of the global |
10 | 10 | * statement should not be allowed. |
11 | 11 | * |
| 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 | + * |
12 | 17 | * @author Trevor Parscal <tparscal@wikimedia.org> |
13 | 18 | */ |
14 | 19 | class HtmlUiTemplate { |
15 | 20 | |
16 | 21 | /* Protected Members */ |
17 | 22 | |
| 23 | + /** String: Path to template file */ |
18 | 24 | protected $filePath; |
19 | 25 | |
20 | 26 | /* Methods */ |
— | — | @@ -80,12 +86,14 @@ |
81 | 87 | } |
82 | 88 | |
83 | 89 | /** |
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. |
89 | 91 | * |
| 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 | + * |
90 | 98 | * @param $data Mixed: Data to make into attributes, string or array of strings or an array of |
91 | 99 | * attribute/value pairs where a value can either be a string or an array and will be |
92 | 100 | * imploded with a space delimiter. |