當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Header::meta方法代碼示例

本文整理匯總了PHP中Header::meta方法的典型用法代碼示例。如果您正苦於以下問題:PHP Header::meta方法的具體用法?PHP Header::meta怎麽用?PHP Header::meta使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Header的用法示例。


在下文中一共展示了Header::meta方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: getHeader

 protected function getHeader()
 {
     $header = new Header();
     $header->title = $this->title;
     $header->meta("Content-Type", "text/html; charset=utf-8", true);
     $header->meta("description", $this->meta_desc, false);
     $header->meta("keywords", $this->meta_key, false);
     $header->meta("viewport", "width=device-width", false);
     $header->favicon = "/favicon.ico";
     if (strpos($_SERVER['HTTP_USER_AGENT'], 'MSIE 8.0')) {
         $header->css = array("/styles/main.css", "/styles/prettify.css", "/styles/unite-gallery.css", "/styles/ie.css");
     } elseif (strpos($_SERVER['HTTP_USER_AGENT'], 'Safari/525.29')) {
         $header->css = array("/styles/main.css", "/styles/prettify.css", "/styles/unite-gallery.css", "/styles/safari3.css");
     } elseif (strpos($_SERVER['HTTP_USER_AGENT'], 'MSIE 7.0')) {
         $header->css = array("/styles/reject.css");
     } elseif (strpos($_SERVER['HTTP_USER_AGENT'], 'MSIE 6.0')) {
         $header->css = array("/styles/reject.css");
     } elseif (strpos($_SERVER['HTTP_USER_AGENT'], 'MSIE 5.5')) {
         $header->css = array("/styles/reject.css");
     } else {
         $header->css = array("/styles/main.css", "/styles/prettify.css", "/styles/unite-gallery.css");
     }
     if (strpos($_SERVER['HTTP_USER_AGENT'], 'MSIE 7.0')) {
         $header->js = array("/js/reject.min.js");
     } elseif (strpos($_SERVER['HTTP_USER_AGENT'], 'MSIE 6.0')) {
         $header->js = array("/js/reject.min.js");
     } elseif (strpos($_SERVER['HTTP_USER_AGENT'], 'MSIE 5.5')) {
         $header->js = array("/js/reject.min.js");
     } else {
         $header->js = array("/js/jquery-11.0.min.js", "/js/functions.js", "/js/validator.js", "/js/prettify.js", "/js/unitegallery.min.js", "/js/ug-theme-compact.js");
     }
     return $header;
 }
開發者ID:andreiBall,項目名稱:main-site,代碼行數:33,代碼來源:controller_class.php

示例2: getHeader

 protected function getHeader()
 {
     $header = new Header();
     $header->title = $this->title;
     $header->meta("Content-Type", "text/html; charset=utf-8", true);
     $header->meta("description", $this->meta_desc, false);
     $header->meta("keywords", $this->meta_key, false);
     $header->meta("viewport", "width=device-width", false);
     $header->favicon = "/favicon.ico";
     $header->css = array("/styles/main.css", "/styles/prettify.css");
     $header->js = array("/js/jquery-1.10.2.min.js", "/js/functions.js", "/js/validator.js", "/js/prettify.js");
     return $header;
 }
開發者ID:itservicedv,項目名稱:engine_rusakov_source,代碼行數:13,代碼來源:controller_class.php


注:本文中的Header::meta方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。