| | 189 | * Creates a meta tag. |
| | 190 | * |
| | 191 | * @param string|array tag name, or an array of tags |
| | 192 | * @param string tag value |
| | 193 | * @return string |
| | 194 | */ |
| | 195 | public static function meta($tag, $value = NULL) |
| | 196 | { |
| | 197 | if (is_array($tag)) |
| | 198 | { |
| | 199 | $tags = array(); |
| | 200 | foreach ($tag as $t => $v) |
| | 201 | { |
| | 202 | // Build each tag and add it to the array |
| | 203 | $tags[] = html::meta($t, $v); |
| | 204 | } |
| | 205 | |
| | 206 | // Return all of the tags as a string |
| | 207 | return implode("\n", $tags); |
| | 208 | } |
| | 209 | |
| | 210 | // HTTP type meta tags |
| | 211 | $http = array('content-type', 'expires', 'refresh', 'set-cookie'); |
| | 212 | |
| | 213 | // Set the type attribute |
| | 214 | $attr = in_array($tag, $http) ? 'http-equiv' : 'name'; |
| | 215 | |
| | 216 | return '<meta '.$attr.'="'.$value.'" />'; |
| | 217 | } |
| | 218 | |
| | 219 | /** |