Skip to content

scottbedard/oc-useragent-plugin

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 

Repository files navigation

User Agent

Simple user agent detection for OctoberCMS.

Documentation

This plugin is just a simple Twig wrapper for Laravel User Agent, please refer to their repository for documentation.

Examples

Detecting devices...

{% 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...

{% if agent('isRobot') %}
    Hello robot!
{% endif %}

Detecting a specific browser...

{% if agent('browser') == 'Chrome' %}
    Welcome Chrome user!
{% endif %}

Detecting a specific device...

{% if agent('device') == 'iPhone' %}
    Aloha iPhone user!
{% endif %}

About

Simple user agent detection for OctoberCMS.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Languages