derralf/silverstripe-mobiledetect

Simple extension to detect mobile devices

Installs: 1 669

Dependents: 0

Suggesters: 0

Security: 0

Stars: 0

Watchers: 2

Forks: 1

Open Issues: 0

Type:silverstripe-vendormodule

dev-master / 2.x-dev 2024-03-06 13:49 UTC

This package is auto-updated.

Last update: 2024-03-06 13:49:59 UTC


README

Requirements

  • silverstripe/cms ^5
  • mobiledetect/mobiledetectlib ^4.8

For a SilverStripe 4.3 compatible version of this module, please see the 1.x release line 1.x release line.

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