bolt/browsercheck
Composer 安装命令:
composer require bolt/browsercheck
包简介
💻 This Bolt extension works with the User-Agent to detect devices (desktop, tablet, mobile, etc.), clients, operating systems, brands and models.
README 文档
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
统计信息
- 总下载量: 157
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 1
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2020-11-26