bolt/browsercheck

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

Installs: 135

Dependents: 0

Suggesters: 0

Security: 0

Stars: 1

Watchers: 4

Forks: 1

Open Issues: 0

Type:bolt-extension

0.0.2 2020-11-26 12:20 UTC

This package is auto-updated.

Last update: 2024-09-26 21:11:17 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