/** * Container data setter * @param string $name meta name * @param string $value meta value * @param array $attr Extra attributes */ public static function set($name, $value, array $attr = array()) { $_name = self::key($name); $attrs['property'] = 'og:' . preg_replace('/\\Aog:/i', '', $name); $attrs['content'] = $value; $data = self::data($_name, $attrs); HeadsContainer::set('ogp', $data); }
/** * Container data setter * @param string $name meta name * @param string $value meta value * @param array $attr Extra attributes */ public static function set($name, $value, array $attr = array()) { $name = str_replace(' ', '-', ucwords(str_replace('-', ' ', $name))); $attrs['http-equiv'] = $name; $attrs['content'] = $value; $data = self::data($name, $attrs); HeadsContainer::set('http', $data); }
/** * Container data setter * @param string $name meta name * @param string $value meta value * @param array $attr Extra attributes */ public static function set($name, $value, array $attr = array()) { $attrs['rel'] = $name; $attrs['href'] = $value; if (is_string($attrs)) { $attrs['title'] = $attr; } $data = self::data($name, $attrs); HeadsContainer::set('link', $data); }
/** * Container data setter * @param string $name meta name * @param string $value meta value * @param array $attr Extra attributes */ public static function set($name, $value, array $attr = array()) { $_name = self::key($name); if (false !== array_search($_name, self::$availables)) { $attrs['property'] = 'fb:' . preg_replace('/\\Afb:/i', '', $name); $attrs['content'] = $value; $data = self::data($_name, $attrs); HeadsContainer::set('facebook', $data); } else { HeadsMain::ogp('og:' . preg_replace('/\\Afb:/i', '', $name), $value, $attr); } }
/** * Add Apple Link data * @param string $name meta name * @param mixed $value meta value, If set 'false' to remove tag data * @param mixed $attr Extra attributes * @return bool */ public static function applelink($name, $value = null, $attrs = array()) { if (is_array($name)) { if (!empty($name['ios:url'])) { foreach ($name as $key => $val) { self::applelink($key, $val); } } return true; } if (HeadsAppleLink::has($name)) { if ($data = HeadsAppleLink::get($name, $value, $attrs)) { HeadsContainer::set('applelink', $data); } else { HeadsAppleLink::set($name, $value, $attrs); } return true; } return false; }