当前位置: 首页>>代码示例>>PHP>>正文


PHP Mobile_Detect::isFirefox方法代码示例

本文整理汇总了PHP中Mobile_Detect::isFirefox方法的典型用法代码示例。如果您正苦于以下问题:PHP Mobile_Detect::isFirefox方法的具体用法?PHP Mobile_Detect::isFirefox怎么用?PHP Mobile_Detect::isFirefox使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Mobile_Detect的用法示例。


在下文中一共展示了Mobile_Detect::isFirefox方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1:

    $device .= "Smartphone";
}
// Any tablet device.
if ($detect->isTablet()) {
    $device .= "Tablet";
}
if (!$detect->isTablet() && !$detect->isMobile()) {
    $device .= "Laptop/Computer";
}
// Check for a specific platform with the help of the magic methods:
if ($detect->isiOS()) {
    $device .= " running Apple's iOS";
}
if ($detect->isAndroidOS()) {
    $device .= " running Android";
}
if ($detect->isChrome()) {
    $device .= " with the Browser 'Chrome'";
}
if ($detect->isOpera()) {
    $device .= " with the Browser 'Opera'";
}
if ($detect->isIE()) {
    $device .= " with the Browser 'Internet Explorer'";
}
if ($detect->isFirefox()) {
    $device .= " with the Browser 'Firefox'";
}
if ($detect->isSafari()) {
    $device .= " with the Browser 'Safari'";
}
开发者ID:vantezzen,项目名称:synchro,代码行数:31,代码来源:detectDevice.php

示例2: beforeFilter

 public function beforeFilter()
 {
     parent::beforeFilter();
     if (Configure::read('unloadDebugKit') == true) {
         $this->Components->unload('DebugKit.Toolbar');
     }
     // language initialization
     $language_list = Configure::read('Config.languageList');
     $this->language = $language_list[Configure::read('Config.language')]['code'];
     if (isset($this->params['language'])) {
         foreach ($language_list as $locale => $language) {
             if ($language['active'] && $language['code'] == $this->params['language']) {
                 $this->language = $this->params['language'];
                 Configure::write('Config.language', $locale);
                 break;
             }
         }
     }
     // set language
     $this->set('language', $this->language);
     $this->set('language_list', $language_list);
     $this->Session->write('Config.language', $this->language);
     // Detect device
     $Mobile_Detect = new Mobile_Detect();
     $this->device_info = 'Desktop';
     $this->device_browser = '';
     $this->device_info_type = '';
     if ($Mobile_Detect->isTablet()) {
         $this->device_info = 'Tablet';
         if ($Mobile_Detect->isiPad()) {
             $this->device_info_type = 'Ipad';
         } else {
             if ($Mobile_Detect->isAndroidOS()) {
                 $this->device_info_type = 'Android';
             } else {
                 $this->device_info_type = 'others';
             }
         }
     } else {
         if ($Mobile_Detect->isMobile()) {
             $this->device_info = 'Mobile';
             if ($Mobile_Detect->isiPhone()) {
                 $this->device_info_type = 'Iphone';
             } else {
                 if ($Mobile_Detect->isAndroidOS()) {
                     $this->device_info_type = 'Android';
                 } else {
                     $this->device_info_type = 'others';
                 }
             }
         }
     }
     if ($Mobile_Detect->isChrome() && $Mobile_Detect->isSafari()) {
         $this->device_browser = 'AndroidDefault';
     } else {
         if ($Mobile_Detect->isChrome()) {
             $this->device_browser = 'Chrome';
         } else {
             if ($Mobile_Detect->isSafari()) {
                 $this->device_browser = 'Safari';
             } else {
                 if ($Mobile_Detect->isIE()) {
                     $this->device_browser = 'IE';
                 } else {
                     if ($Mobile_Detect->isFirefox()) {
                         $this->device_browser = 'Firefox';
                     } else {
                         if ($Mobile_Detect->isOpera()) {
                             $this->device_browser = 'Opera';
                         } else {
                             $this->device_browser = 'others';
                         }
                     }
                 }
             }
         }
     }
     $this->set('device_info', $this->device_info);
     $this->set('device_info_type', $this->device_info_type);
     $this->set('device_browser', $this->device_browser);
     //GA account
     $ga_account = Configure::read('ga_account');
     $this->set('ga_account', !empty($ga_account[$this->language]) ? $ga_account[$this->language] : '');
     //FB_appID
     $FB_appID = Configure::read('FB_appID');
     $this->set('FB_appID', $FB_appID);
 }
开发者ID:hongtien510,项目名称:cms_v1,代码行数:87,代码来源:AppController.php


注:本文中的Mobile_Detect::isFirefox方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。