derralf/silverstripe-mobiledetect

simple extension to detect mobile devices - requires serbanghita/Mobile-Detect

Installs: 45

Dependents: 0

Suggesters: 0

Security: 0

Stars: 0

Watchers: 1

Forks: 0

Open Issues: 0

Type:silverstripe-vendormodule

dev-master / 1.x-dev 2019-04-05 17:10 UTC

This package is auto-updated.

Last update: 2020-01-05 18:59:52 UTC


README

Requirements

  • silverstripe/cms ^4
  • mobiledetect/mobiledetectlib ^2

Installation

Install a module via Composer

composer require derralf/silverstripe-mobiledetect

DataObject gets extended automatically

Usage


PHP:

if $this->isMobile() ...

if $this->isTablet() ...

if $this->isPhone() ...


Templates:

<% if $isMobile %> ...

<% if $isTablet %> ...

<% if $isPhone %> ...