Download the PHP package pikanji/agent-plugin without Composer
On this page you can find all versions of the php package pikanji/agent-plugin. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download pikanji/agent-plugin
More information about pikanji/agent-plugin
Files in pikanji/agent-plugin
Package agent-plugin
Short Description Detect user's browser, OS, and device from UserAgent. A wrapper plugin of jenssegers/agent.
License MIT
Informations about the package agent-plugin
OctoberCMS Agent Plugin
日本語版はこちら
OctoberCMS plugin to detect user's browser, OS, and device. This is available not only from PHP but also from Twig templates.
This is a wrapper plugin of jenssegers/agent. Thanks to jenssegers, and also serbanghita created it's base serbanghita/Mobile-Detect.
API
Please refer jenssegers/agent for available APIs.
Usage
Installation
You can install this plugin either via composer or from the backend UI.
With Composer
Execute below at the root of your project.
With OctoberCMS UI
- Login to OctoberCMS backend
- Go to Settings > Update & Plugins.
- Click "Install plugins" button.
- Search for "Agent", and select it to start installation.
Using in Twig Templates
Agent object will be available after Agent component is added to pages or layouts. I recommend to add the component to your layout, so that you don't have to add every page.
Preparation is to add [Agent]
to the configuration section of page or layout files. There is no parameter needed for Agent component.
Then you can use this Agent object to call jenssegers/agent APIs.
Using in PHP Code
Add use Agent;
, and call methods from Agent
facade.
If you don't want to use facade, you can use it like this.
It is just using jenssegers/agent directly. Please refer to its documentation. You don't need to install it since it is installed as the dependency of this plugin.