IPhone6Device
class IPhone6Device extends AppleDevice (View source)
Properties
protected string | $handle | from Device | |
protected string | $name | from Device | |
protected string | $brand | from Device | |
protected string | $orientation | from Device | |
protected string | $agent | from Device | |
protected int | $width | from Device | |
protected int | $height | from Device | |
protected int | $ratio | from Device | |
protected int | $type | from Device |
Methods
No description
Get the screen width of the device in pixels Be sure to adjust this by the device pixel ratio.
Get the screen height of the device in pixels Be sure to adjust this by the device pixel ratio.
Get the devices type this is an int that maps to a constant on this class, UNKNOWN MOBILE TABLET or DESKTOP If testing against a device and not against "UNKNOWN", do not test this directly against a device type, instead use bitwise AND to test for the enum you'd like to test:.
Get the HTML for this device's viewport.
Construct from given configuration.
Details
in
Device at line 67
__construct(string $handle, string $name, string $brand, string $user_agent, int $width, int $height, int $type, int $ratio = 1)
No description
in
Device at line 84
string
getHandle()
Get the device handle.
in
Device at line 94
string
getName()
Get the device name.
string
getBrand()
Get the device brand.
string
getUserAgent()
Get the device user agent.
int
getWidth()
Get the screen width of the device in pixels Be sure to adjust this by the device pixel ratio.
int
getHeight()
Get the screen height of the device in pixels Be sure to adjust this by the device pixel ratio.
int
getType()
Get the devices type this is an int that maps to a constant on this class, UNKNOWN MOBILE TABLET or DESKTOP If testing against a device and not against "UNKNOWN", do not test this directly against a device type, instead use bitwise AND to test for the enum you'd like to test:.
// Check if the type is known, if so is it mobile? if ($device->getType() == Device::UNKNOWN) { $is_mobile = !!($device->getPixelRatio() & Device::MOBILE); }
int
getPixelRatio()
Get the device pixel ratio.
string
getViewportHTML()
Get the HTML for this device's viewport.
string
getIconClass()
Get the class to be used for this device's icon.
bool
isMobile()
No description
bool
isTablet()
No description
bool
isDesktop()
No description
string
getDefaultOrientation()
Get the device's default orientation.
static DeviceInterface
configConstructor($handle, array $config)
Construct from given configuration.