/** * Set the default meta tags * * Using configuration settings. * * @uses Meta::tags * @uses Arr::get * @uses Arr::merge */ protected function _set_default_meta_tags() { $meta = $this->_config->get('meta', array()); $keywords = $this->_config->get('keywords', ''); $description = $this->_config->get('description', ''); $tags = Arr::get($meta, 'tags'); $tags = Arr::merge($tags, array('keywords' => $keywords), array('description' => $description)); if ($tags) { foreach ($tags as $handle => $value) { $conditional = NULL; if (is_array($value)) { $conditional = Arr::get($value, 'conditional'); $value = Arr::get($value, 'value', ''); } $attrs = array(); if (isset($conditional)) { $attrs['conditional'] = $conditional; } Meta::tags($handle, $value, $attrs); } } }
<!DOCTYPE html> <html lang="<?php echo $lang; ?> "> <head> <title><?php echo $head_title; ?> </title> <?php echo Meta::tags(); ?> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <?php echo Meta::links(); ?> <?php echo Assets::css(); ?> <link href='//fonts.googleapis.com/css?family=Kaushan+Script' rel='stylesheet' type='text/css'> <!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries --> <!-- WARNING: Respond.js doesn't work if you view the page via file:// --> <!--[if lt IE 9]> <?php echo HTML::script('media/js/html5shiv.js', NULL, TRUE); ?> <?php echo HTML::script('media/js/respond.min.js', NULL, TRUE); ?> <![endif]-->
/** * Remove a Meta Tag, or all * * @param string|NULL $handle Asset name, or NULL to remove all [Optional] * * @return mixed Empty array or void */ public static function remove_tags($handle = NULL) { if (is_null($handle)) { return self::$tags = array(); } unset(self::$tags[$handle]); }