2017 © Pedro Peláez
 

silverstripe-module browser-information

SilverStripe Module detecting browser information

image

meerware/browser-information

SilverStripe Module detecting browser information

  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 1 Forks
  • 1 Open issues
  • 4 Versions
  • 4 % Grown

The README.md

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., (*1)

Requirements

  • SilverStripe 3 or higher

Usage

The module automatically extends all Controllers to have two methods:, (*2)

$controller->getBrowser();
$controller->Browser();

Both returning a Browser class which wraps the browser name, version, operating system and device type., (*3)

Browser Name

$browser->getName();

The browser name is crude but will return one of the following:, (*4)

  • ie
  • firefox
  • chrome
  • safari
  • netscape
  • opera
  • konqueror
  • unknown

Browser Version

$browser->getVersion();

The browser version will return a string value in the format of "X.X", just the major and minor version numbers if present., (*5)

Operating System

$browser->getSystem();

The operating system will return one of the following values:, (*6)

  • linux
  • macintosh
  • windows
  • ios
  • android
  • unknown

Device

$browser->getDevice();

Device detects whether the browser is either a handheld or a screen device (mobile/tablet or desktop/laptop) and will return the following values:, (*7)

  • screen
  • handheld

Engine

$browser->getEngine();

Detects the browser rendering engine and will return the following values:, (*8)

  • 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:, (*9)

<html class="$Browser">

Will be evaluated to something like:, (*10)

<html class="macintosh firefox firefox22 screen gecko">

The Versions

11/03 2016

dev-master

9999999-dev https://github.com/meerware/silverstripe-browser-information

SilverStripe Module detecting browser information

  Sources   Download

BSD

The Requires

 

silverstripe browser

17/07 2013

0.3

0.3.0.0 https://github.com/meerware/silverstripe-browser-information

SilverStripe Module detecting browser information

  Sources   Download

BSD

The Requires

 

silverstripe browser

16/07 2013

0.2

0.2.0.0 https://github.com/meerware/silverstripe-browser-information

SilverStripe Module detecting browser information

  Sources   Download

BSD

The Requires

 

silverstripe browser

16/07 2013

0.1

0.1.0.0 https://github.com/meerware/silverstripe-browser-information

SilverStripe Module detecting browser information

  Sources   Download

BSD

The Requires

 

silverstripe browser