2017 © Pedro Peláez
 

craft-plugin craft3-mobiledetect

Use Mobile_Detect for detecting mobile devices (including tablets)

image

superbig/craft3-mobiledetect

Use Mobile_Detect for detecting mobile devices (including tablets)

  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 1 Forks
  • 1 Open issues
  • 3 Versions
  • 114 % Grown

The README.md

MobileDetect plugin for Craft CMS 3.x

Use Mobile_Detect for detecting mobile devices (including tablets), (*1)

Screenshot, (*2)

Requirements

This plugin requires Craft CMS 3.0.0-beta.23 or later., (*3)

Installation

To install the plugin, follow these instructions., (*4)

  1. Open your terminal and go to your Craft project:, (*5)

    cd /path/to/project
  2. Then tell Composer to load the plugin:, (*6)

    composer require superbig/craft3-mobiledetect
  3. In the Control Panel, go to Settings → Plugins and click the “Install” button for MobileDetect., (*7)

MobileDetect Overview

fairly complete wrapper for the Mobile_Detect library by @serbanghita.**, (*8)

Using MobileDetect

The plugin exposes most of Mobile_Detect's methods, and can be used in your Twig:, (*9)

{{ craft.mobileDetect.isMobile ? 'I am mobile.' : 'I am not mobile.' }}

...or as a PHP service:, (*10)

<?php
$isMobile = MobileDetect::$plugin->mobileDetect->isMobile();

Methods/usage

Device detection

isMobile

Detects all mobile devices, both phones and tablets, (*11)

isTablet
isPhone

Mobile OS detection

isiOS
isAndroidOS
isBlackBerryOS
isPalmOS
isSymbianOS
isWindowsMobileOS
isWindowsPhoneOS

Other methods

is(key)

Test for anything, e.g. is('iphone'), (*12)

match(pattern)

Test using regular expressions, (*13)

version(component)

Get the version of a component, e.g. version('iPhone'), (*14)

mobileGrade

Get browser grade (e.g. "A"), (*15)

getScriptVersion

Prints the MobileDetect library's version, (*16)

getUserAgent
setUserAgent(userAgent)
getMobileHeaders
getHttpHeaders
setHttpHeaders(httpHeaders)
getCfHeaders
setCfHeaders(cfHeaders)

Brought to you by Superbig, (*17)

The Versions

30/01 2018

dev-master

9999999-dev

Use Mobile_Detect for detecting mobile devices (including tablets)

  Sources   Download

MIT

The Requires

 

cms mobiledetect craftcms craft-plugin craft

06/11 2017

1.0.1

1.0.1.0

Use Mobile_Detect for detecting mobile devices (including tablets)

  Sources   Download

MIT

The Requires

 

cms mobiledetect craftcms craft-plugin craft

05/11 2017

1.0.0

1.0.0.0

Use Mobile_Detect for detecting mobile devices (including tablets)

  Sources   Download

MIT

The Requires

 

cms mobiledetect craftcms craft-plugin craft