定制 meerware/browser-information 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

meerware/browser-information

Composer 安装命令:

composer require meerware/browser-information

包简介

SilverStripe Module detecting browser information

README 文档

README

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:

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

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

Browser Name

$browser->getName();

The browser name is crude but will return one of the following:

  • 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.

Operating System

$browser->getSystem();

The operating system will return one of the following values:

  • 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:

  • screen
  • handheld

Engine

$browser->getEngine();

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:

<html class="$Browser">

Will be evaluated to something like:

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

统计信息

  • 总下载量: 341
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 10
  • 点击次数: 0
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 10
  • Watchers: 2
  • Forks: 1
  • 开发语言: PHP

其他信息

  • 授权协议: BSD
  • 更新时间: 2013-07-16

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固