bolt/browsercheck

💻 This Bolt extension works with the User-Agent to detect devices (desktop, tablet, mobile, etc.), clients, operating systems, brands and models.

Installs: 68

Dependents: 0

Suggesters: 0

Security: 0

Stars: 0

Watchers: 3

Forks: 0

Open Issues: 0

Type:bolt-extension

0.0.2 2020-11-26 12:20 UTC

This package is auto-updated.

Last update: 2021-09-26 14:35:54 UTC


README

This Bolt extension works with the User-Agent to detect devices (desktop, tablet, mobile, etc.), clients, operating systems, brands and models.

How to install

composer require bolt/browsercheck

How to use

The extension defined a global Twig variable called browsercheck, which gives you access to a lot of properties based on the User-Agent.

Get browser name

{{ browsercheck.client.name }}

Get browser version

{{ browsercheck.client.version }}

Get the operating system name

{{ browsercheck.os.name }}

Get the operating system version

{{ browsercheck.os.version }}

How to view all possible properties

There are many more properties available. To print them all, use:

{{ dump(browsercheck) }}

Behind the scenes, the browsercheck Twig global variable is an instance of Matomo's Device Detection Library.

Any method that is available to the DeviceDetector class is accessible through the browsercheck variable defined by this extension.

Running PHPStan and Easy Codings Standard

First, make sure dependencies are installed:

COMPOSER_MEMORY_LIMIT=-1 composer update

And then run ECS:

vendor/bin/ecs check src