protected static function prepare($config) { // Handle spec requirements // If the name or http-equiv attribute is in place, there must be a content key if ((isset($config['name']) || isset($config['http-equiv'])) && !isset($config['content'])) { // name or http-equiv must have content die(get_class() . ' - fatal error: when name or http-equiv are set, content must also be set'); } if (!isset($config['charset'])) { $config = Meta::configAfterConvertingKeyToAttribute($config, 'content'); } return $config; }
/** * http://www.w3.org/TR/html5/document-metadata.html#the-meta-element * * Required keys * type: name|http-equiv|charset * * Optional keys * content: Arbitrary non-html string. If name or http-equiv types are selected, `content` becomes required. * name: application-name|author|description|generator|keywords If name type is selected, `name` becomes required. * http-equiv: content-language|content-type|default-style|refresh|set-cookie If http-equiv type is selected, `http-equiv` becomes required. * charset: Valid character encoding declaration. If charset type is selected, `charset` becomes required. * * See global optional keys above. * */ public static function meta($config) { return Meta::build($config); }