PHP Class Pop\Web\Mobile

Author: Nick Sagona, III ([email protected])
显示文件 Open project: nicksagona/PopPHP Class Usage Examples

Protected Properties

Property Type Description
$android boolean Android flag
$apple boolean Apple flag
$blackberry boolean Blackberry flag
$desktopUrl string Desktop website destination URL
$device string Mobile Device
$force integer Force flag
$mobile boolean Mobile detect flag
$mobileUrl string Mobile website destination URL
$opera boolean Opera flag
$pre boolean Pre flag
$tablet boolean Tablet detect flag
$ua string User agent property
$windows boolean Windows flag

Public Methods

Method Description
__construct ( string $mobile = null, string $desktop = null, integer $force ) : Mobile Constructor
getDesktopUrl ( ) : string Method to get desktop URL
getDevice ( ) : string Method to get device name
getForce ( ) : integer Method to get force flag
getMobileDevice ( ) : string Static method to only get the mobile device.
getMobileUrl ( ) : string Method to get mobile URL
getUa ( ) : string Method to get user-agent
goToDesktop ( ) : void Method to go to the desktop site.
goToMobile ( ) : void Method to go to the mobile site.
goToURL ( string $url ) : void Method to go to a specific URL.
isAndroid ( ) : boolean Method to get Android flag
isApple ( ) : boolean Method to get Apple flag
isBlackberry ( ) : boolean Method to get Blackberry flag
isMobile ( ) : boolean Method to get is mobile flag
isMobileDevice ( ) : boolean Static method to only detect a mobile device or not.
isOpera ( ) : boolean Method to get Opera flag
isPre ( ) : boolean Method to get Pre flag
isTablet ( ) : boolean Method to get is tablet flag
isTabletDevice ( ) : boolean Static method to only detect a tablet device or not.
isWindows ( ) : boolean Method to get Windows flag
route ( ) : void Method to route to the appropriate URL
setDesktopUrl ( string $url ) : Mobile Method to set desktop URL
setForce ( integer $force ) : Mobile Method to set force flag
setMobileUrl ( string $url ) : Mobile Method to set mobile URL

Protected Methods

Method Description
detect ( ) : boolean Method to detect whether or not the device is a mobile device or not.

Method Details

__construct() public method

Instantiate the mobile session object.
public __construct ( string $mobile = null, string $desktop = null, integer $force ) : Mobile
$mobile string
$desktop string
$force integer
return Mobile

detect() protected method

Method to detect whether or not the device is a mobile device or not.
protected detect ( ) : boolean
return boolean

getDesktopUrl() public method

Method to get desktop URL
public getDesktopUrl ( ) : string
return string

getDevice() public method

Method to get device name
public getDevice ( ) : string
return string

getForce() public method

Method to get force flag
public getForce ( ) : integer
return integer

getMobileDevice() public static method

Static method to only get the mobile device.
public static getMobileDevice ( ) : string
return string

getMobileUrl() public method

Method to get mobile URL
public getMobileUrl ( ) : string
return string

getUa() public method

Method to get user-agent
public getUa ( ) : string
return string

goToDesktop() public method

Method to go to the desktop site.
public goToDesktop ( ) : void
return void

goToMobile() public method

Method to go to the mobile site.
public goToMobile ( ) : void
return void

goToURL() public method

Method to go to a specific URL.
public goToURL ( string $url ) : void
$url string
return void

isAndroid() public method

Method to get Android flag
public isAndroid ( ) : boolean
return boolean

isApple() public method

Method to get Apple flag
public isApple ( ) : boolean
return boolean

isBlackberry() public method

Method to get Blackberry flag
public isBlackberry ( ) : boolean
return boolean

isMobile() public method

Method to get is mobile flag
public isMobile ( ) : boolean
return boolean

isMobileDevice() public static method

Static method to only detect a mobile device or not.
public static isMobileDevice ( ) : boolean
return boolean

isOpera() public method

Method to get Opera flag
public isOpera ( ) : boolean
return boolean

isPre() public method

Method to get Pre flag
public isPre ( ) : boolean
return boolean

isTablet() public method

Method to get is tablet flag
public isTablet ( ) : boolean
return boolean

isTabletDevice() public static method

Static method to only detect a tablet device or not.
public static isTabletDevice ( ) : boolean
return boolean

isWindows() public method

Method to get Windows flag
public isWindows ( ) : boolean
return boolean

route() public method

Method to route to the appropriate URL
public route ( ) : void
return void

setDesktopUrl() public method

Method to set desktop URL
public setDesktopUrl ( string $url ) : Mobile
$url string
return Mobile

setForce() public method

Method to set force flag
public setForce ( integer $force ) : Mobile
$force integer
return Mobile

setMobileUrl() public method

Method to set mobile URL
public setMobileUrl ( string $url ) : Mobile
$url string
return Mobile

Property Details

$android protected_oe property

Android flag
protected bool $android
return boolean

$apple protected_oe property

Apple flag
protected bool $apple
return boolean

$blackberry protected_oe property

Blackberry flag
protected bool $blackberry
return boolean

$desktopUrl protected_oe property

Desktop website destination URL
protected string $desktopUrl
return string

$device protected_oe property

Mobile Device
protected string $device
return string

$force protected_oe property

Force flag
protected int $force
return integer

$mobile protected_oe property

Mobile detect flag
protected bool $mobile
return boolean

$mobileUrl protected_oe property

Mobile website destination URL
protected string $mobileUrl
return string

$opera protected_oe property

Opera flag
protected bool $opera
return boolean

$pre protected_oe property

Pre flag
protected bool $pre
return boolean

$tablet protected_oe property

Tablet detect flag
protected bool $tablet
return boolean

$ua protected_oe property

User agent property
protected string $ua
return string

$windows protected_oe property

Windows flag
protected bool $windows
return boolean