PHP Класс browser, kirby

Показать файл Открыть проект Примеры использования класса

Открытые свойства

Свойство Тип Описание
$engine string The readable browser engine name For example: "webkit"
$ios boolean True or false if it is an iOS device or not
$iphone boolean True or false if it is an iPhone or not
$mobile boolean True or false if it is a mobile device or not
$name string The readable name of the browser For example: "ie"
$platform string The platform name For example: "mac"
$ua string The entire user agent string
$version string The browser version number For example: "3.6"

Открытые методы

Метод Описание
css ( string $ua = null, boolean $array = false ) : mixed Returns a browser-specific css selector string
detect ( string $ua = null ) : array The core detection method, which parses the user agent string
engine ( string $ua = null ) : string Returns the browser engine
ios ( string $ua = null ) : boolean Checks if the user agent string is from an iOS device
iphone ( string $ua = null ) : boolean Checks if the user agent string is from an iPhone
mobile ( string $ua = null ) : boolean Checks if the user agent string is from a mobile device
name ( string $ua = null ) : string Returns the name of the browser
platform ( string $ua = null ) : string Returns the platform
version ( string $ua = null ) : string Returns the browser version

Описание методов

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

Returns a browser-specific css selector string
static public css ( string $ua = null, boolean $array = false ) : mixed
$ua string The user agent string
$array boolean True: return an array, false: return a string
Результат mixed

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

The core detection method, which parses the user agent string
static public detect ( string $ua = null ) : array
$ua string The user agent string
Результат array An array with all parsed info

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

Returns the browser engine
static public engine ( string $ua = null ) : string
$ua string The user agent string
Результат string The browser engine

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

Checks if the user agent string is from an iOS device
static public ios ( string $ua = null ) : boolean
$ua string The user agent string
Результат boolean True: iOS device, false: not an iOS device

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

Checks if the user agent string is from an iPhone
static public iphone ( string $ua = null ) : boolean
$ua string The user agent string
Результат boolean True: iPhone, false: not an iPhone

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

Checks if the user agent string is from a mobile device
static public mobile ( string $ua = null ) : boolean
$ua string The user agent string
Результат boolean True: mobile device, false: not a mobile device

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

Returns the name of the browser
static public name ( string $ua = null ) : string
$ua string The user agent string
Результат string The browser name

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

Returns the platform
static public platform ( string $ua = null ) : string
$ua string The user agent string
Результат string The platform name

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

Returns the browser version
static public version ( string $ua = null ) : string
$ua string The user agent string
Результат string The browser version

Описание свойств

$engine публичное статическое свойство

The readable browser engine name For example: "webkit"
public static string $engine
Результат string

$ios публичное статическое свойство

True or false if it is an iOS device or not
public static bool $ios
Результат boolean

$iphone публичное статическое свойство

True or false if it is an iPhone or not
public static bool $iphone
Результат boolean

$mobile публичное статическое свойство

True or false if it is a mobile device or not
public static bool $mobile
Результат boolean

$name публичное статическое свойство

The readable name of the browser For example: "ie"
public static string $name
Результат string

$platform публичное статическое свойство

The platform name For example: "mac"
public static string $platform
Результат string

$ua публичное статическое свойство

The entire user agent string
public static string $ua
Результат string

$version публичное статическое свойство

The browser version number For example: "3.6"
public static string $version
Результат string