Pop\Web\Mobile::isTabletDevice PHP Метод

isTabletDevice() публичный статический Метод

Static method to only detect a tablet device or not.
public static isTabletDevice ( ) : boolean
Результат boolean
    public static function isTabletDevice()
    {
        $mob = new static();
        return $mob->isTablet();
    }

Usage Example

Пример #1
0
 /**
  * Method to determine the mobile device
  *
  * @param  string $mobile
  * @return string
  */
 public static function getDevice($mobile = null)
 {
     $session = Session::getInstance();
     if (null !== $mobile) {
         $force = $mobile;
         if ($force == 'clear') {
             unset($session->mobile);
         } else {
             $session->mobile = $force;
         }
     }
     if (!isset($session->mobile)) {
         $device = Mobile::getDevice();
         if (null !== $device) {
             $device = strtolower($device);
             if ($device == 'android' || $device == 'windows') {
                 $device .= Mobile::isTabletDevice() ? '-tablet' : '-phone';
             }
         }
     } else {
         $device = $session->mobile;
     }
     return $device;
 }