Download the PHP package meerware/browser-information without Composer
On this page you can find all versions of the php package meerware/browser-information. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download meerware/browser-information
More information about meerware/browser-information
Files in meerware/browser-information
Package browser-information
Short Description SilverStripe Module detecting browser information
License BSD
Homepage https://github.com/meerware/silverstripe-browser-information
Informations about the package browser-information
Browser Information for SilverStripe
A small module for detecting the browser name, version, operating system and device type through the browser user agent and exposing methods for controllers.
Requirements
- SilverStripe 3 or higher
Usage
The module automatically extends all Controllers to have two methods:
Both returning a Browser class which wraps the browser name, version, operating system and device type.
Browser Name
The browser name is crude but will return one of the following:
- ie
- firefox
- chrome
- safari
- netscape
- opera
- konqueror
- unknown
Browser Version
The browser version will return a string value in the format of "X.X", just the major and minor version numbers if present.
Operating System
The operating system will return one of the following values:
- linux
- macintosh
- windows
- ios
- android
- unknown
Device
Device detects whether the browser is either a handheld or a screen device (mobile/tablet or desktop/laptop) and will return the following values:
- screen
- handheld
Engine
Detects the browser rendering engine and will return the following values:
- gecko
- webkit
- trident
- presto
Templates
When the module is included in your SilverStripe directory structure, the module, through extension, will expose a browser attribute for use in templates:
Will be evaluated to something like: