No description, website, or topics provided.
Switch branches/tags
Nothing to show
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
README.md
agent.php

README.md

USER AGENT PLUGIN

Plugin for PyroCMS. A complete reflection of the Codeigniter User Agent Class plus a few extra methods for hiding and showing content on mobile devices.


USAGE

IS MOBILE HIDE

Hide content from mobile devices.

Arguments

  • match (optional) - The module"s slug.

Example

{{ agent:is_mobile_hide }}  

    You won't see this on mobile.

{{ /agent:is_mobile_hide }}

IS MOBILE SHOW

Show content on mobile devices only.

Arguments

  • match (optional) - The module"s slug.

Example

{{ agent:is_mobile_show }}

    This is only shown on mobile devices.

{{ /agent:is_mobile_show }}

IS BROWSER

Returns TRUE/FALSE (boolean) if the user agent is a known web browser.

Arguments

  • match (optional) - The module"s slug.

Example

{{ if { agent:is_browser match="Firefox" } }}

    Yes, this is Firefox.
    
{{ else }}

    No, this is not Firefox.

{{ endif }}

BROWSER

Returns a string containing the name of the web browser viewing your site.

Arguments

  • none

Example

{{ agent:browser }}

VERSION

Returns a string containing the version number of the web browser viewing your site.

Arguments

  • none

    {{ agent:version }}


IS MOBILE

Returns TRUE/FALSE (boolean) if the user agent is a known mobile device.

Arguments

  • none

Example

{{ if { agent:is_mobile } }}

    Yes it is.

{{ else }}

    No.

{{ endif }}

MOBILE

Returns a string containing the name of the mobile device viewing your site.

Arguments

  • none

Example

{{ agent:mobile }}

IS ROBOT

Returns TRUE/FALSE (boolean) if the user agent is a known robot.

Arguments

  • none

Example

{{ if { agent:is_robot } }}

    Yes it is.

{{ else }}

    No.

{{ endif }}

ROBOT

Returns a string containing the name of the robot viewing your site.

Arguments

  • none

Example

{{ agent:robot }}

PLATFORM

Returns a string containing the platform viewing your site (Linux, Windows, OS X, etc.).

Arguments

  • none

Example

{{ agent:platform }}

IS REFERRAL

Returns TRUE/FALSE (boolean) if the user agent was referred from another site.

Arguments

  • none

Example

{{ if { agent:is_referral } }}

    Yes it is.

{{ else }}

    No.

{{ endif }}

REFERRER

Returns a string of the referrer site.

Arguments

  • none

Example

{{ agent:referrer }}

FULL STRING

Returns a string containing the full user agent string.

Arguments

  • none

Example

{{ agent:full_string }}

ACCEPT LANGUAGE

Lets you determine if the user agent accepts a particular language.

Arguments

  • match (optional) - The language code.

Example

{{ agent:accept_language match="en" }}

ACCEPT CHARSET

Lets you determine if the user agent accepts a particular character set.

Arguments

  • match (optional) - The charset name.

Example

{{ agent:accept_charset match="utf-8"}}