Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/scottbedard/oc-useragent-plugin
Simple user agent detection for OctoberCMS.
https://github.com/scottbedard/oc-useragent-plugin
Last synced: 2 months ago
JSON representation
Simple user agent detection for OctoberCMS.
- Host: GitHub
- URL: https://github.com/scottbedard/oc-useragent-plugin
- Owner: scottbedard
- Created: 2015-05-05T06:50:10.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2018-01-10T11:29:38.000Z (almost 7 years ago)
- Last Synced: 2024-03-20T16:20:47.713Z (10 months ago)
- Language: PHP
- Size: 93.8 KB
- Stars: 6
- Watchers: 4
- Forks: 6
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# User Agent
Simple user agent detection for OctoberCMS.### Documentation
This plugin is just a simple Twig wrapper for [Laravel User Agent](https://github.com/jenssegers/Laravel-Agent), please refer to their repository for documentation.### Examples
Detecting devices...
```html
{% if agent('isDesktop') %}
You're using a desktop!
{% elseif agent('isTablet') %}
You're using a tablet!
{% elseif agent('isMobile') %}
You're using a mobile device!
{% endif %}
```Detecting robots...
```html
{% if agent('isRobot') %}
Hello robot!
{% endif %}
````Detecting a specific browser...
```html
{% if agent('browser') == 'Chrome' %}
Welcome Chrome user!
{% endif %}
```Detecting a specific device...
```html
{% if agent('device') == 'iPhone' %}
Aloha iPhone user!
{% endif %}
```