Jenssegers\Agent\Agent::isDesktop PHP Method

isDesktop() public method

Check if the device is a desktop computer.
public isDesktop ( string $userAgent = null, array $httpHeaders = null ) : boolean
$userAgent string deprecated
$httpHeaders array deprecated
return boolean
    public function isDesktop($userAgent = null, $httpHeaders = null)
    {
        return !$this->isMobile() && !$this->isTablet() && !$this->isRobot();
    }

Usage Example

コード例 #1
2
ファイル: appListController.php プロジェクト: nufaylr/mam
 public function detectDevice()
 {
     // @ https://github.com/jenssegers/agent
     $agent = new Agent();
     if ($agent->isMobile() || $agent->isTablet()) {
         if ($agent->is('android')) {
             return 'android';
         }
         if ($agent->is('iOS')) {
             return 'ios';
         }
         return $agent->platform();
     }
     if ($agent->isDesktop()) {
         if ($agent->is('Windows')) {
             return 'windows';
         }
         if ($agent->is('OS X')) {
             return 'OSX';
         }
         return 'desktop';
     }
 }
All Usage Examples Of Jenssegers\Agent\Agent::isDesktop