Download the PHP package s1syphos/kirby-device without Composer
On this page you can find all versions of the php package s1syphos/kirby-device. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download s1syphos/kirby-device
More information about s1syphos/kirby-device
Files in s1syphos/kirby-device
Package kirby-device
Short Description Comprehensive user agent & device detection for Kirby
License MIT
Informations about the package kirby-device
Kirby Device
This plugin detects devices (such as desktop, tablet, mobile, tv, cars, console, ..), clients (browsers, feed readers, media players, PIMs, ..) as well as operating systems, brands and models.
Table of contents
- 1. Main features
- 2. Getting started
- 3. Configuration
- 4. Available methods
- 5. Examples
- 6. Credits / License
Main features
kirby-device
provides the device()
function for parsing information from the target's user agent (UA) - the black-magic voodoo science of regular expressions then enables you to identify
- operating systems
- browsers
- browser engines
- libraries (eg cURL, Perl, Wget, ..)
- media players
- personal information managers (PIMs)
- feed readers
- brands & devices
- .. and of course: bots
Getting started
Use one of the following methods to install & use kirby-device
:
Git submodule
If you know your way around Git, you can download this plugin as a submodule:
Composer
Clone or download
Activate the plugin
Activate the plugin with the following line in your config.php
:
Configuration
Change kirby-device
options to suit your needs:
Option | Type | Default | Description |
---|---|---|---|
plugin.kirby-device.truncate-version |
String | minor |
Defines the browser build or version format according to the semantic versioning specification (allowed values are major , minor , patch as well as build & none ). |
plugin.kirby-device.enable-filecache |
Boolean | true |
Optionally enables / disables filecache. |
Available methods
These methods are available to meet your device detection requirements:
Unless stated, all getSomething()
methods return strings and all isSomething()
methods return booleans.
Examples
Check for mobile environment
Check for tablet device
Only show code on desktop or tablet device
.. and much more!
Feel free to write your own methods:
For more information, see the project's repo or check out its demo page.
Credits / License
kirby-device
is based on Matomo's DeviceDetector and was inspired by Sonja Broda's Kirby plugin kirby-mobile-detect (an implementation of Şerban Ghiţă's Mobile-Detect). It is licensed under the next step?
Special Thanks
I'd like to thank everybody that's making great software - you people are awesome. Also I'm always thankful for feedback and bug reports :)