Class UserAgent

Summary

Fully Qualified Name: CodeIgniter\HTTP\UserAgent

Description

Abstraction for an HTTP user agent

Methods

Name Description Defined By
__construct() Constructor UserAgent
__toString() Outputs the original Agent String when cast as a string. UserAgent
getAgentString() Agent String UserAgent
getBrowser() Get Browser Name UserAgent
getMobile() Get the Mobile Device UserAgent
getPlatform() Get Platform UserAgent
getReferrer() Get the referrer UserAgent
getRobot() Get The Robot Name UserAgent
getVersion() Get the Browser Version UserAgent
isBrowser() Is Browser UserAgent
isMobile() Is Mobile UserAgent
isReferral() Is this a referral from another site? UserAgent
isRobot() Is Robot UserAgent
parse() Parse a custom user-agent string UserAgent

Method Details

__construct()

Constructor

Sets the User Agent and runs the compilation routine

Parameter Name Type Description
$config null

Returns:

__toString()

Outputs the original Agent String when cast as a string.

Returns: string

getAgentString()

Agent String

Returns: string

getBrowser()

Get Browser Name

Returns: string

getMobile()

Get the Mobile Device

Returns: string

getPlatform()

Get Platform

Returns: string

getReferrer()

Get the referrer

Returns: string

getRobot()

Get The Robot Name

Returns: string

getVersion()

Get the Browser Version

Returns: string

isBrowser()

Is Browser

Parameter Name Type Description
$key string

Returns: bool

isMobile()

Is Mobile

Parameter Name Type Description
$key string

Returns: bool

isReferral()

Is this a referral from another site?

Returns: bool

isRobot()

Is Robot

Parameter Name Type Description
$key string

Returns: bool

parse()

Parse a custom user-agent string

Parameter Name Type Description
$string string

Returns: void

Top