PHPackages                             bugbuster/mobiledetection - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. bugbuster/mobiledetection

ActiveContao-module

bugbuster/mobiledetection
=========================

Contao helper class for detecting mobile phones and tablets (device type). A Hook adds a CSS class in the body tag.

3.5.0(11y ago)1139[1 issues](https://github.com/BugBuster1701/mobiledetection/issues)LGPL-3.0+PHPPHP &gt;=5.3

Since Nov 2Pushed 11y ago2 watchersCompare

[ Source](https://github.com/BugBuster1701/mobiledetection)[ Packagist](https://packagist.org/packages/bugbuster/mobiledetection)[ Docs](http://www.contao.glen-langer.de)[ RSS](/packages/bugbuster-mobiledetection/feed)WikiDiscussions master Synced 2mo ago

READMEChangelog (1)Dependencies (3)Versions (7)Used By (0)

Contao Module MobileDetection
=============================

[](#contao-module-mobiledetection)

[![Latest Stable Version](https://camo.githubusercontent.com/a6adc055ed3d1272804c2b870a5cb1783a2036795feed26207d4a20f0436125d/68747470733a2f2f706f7365722e707567782e6f72672f6275676275737465722f6d6f62696c65646574656374696f6e2f762f737461626c652e737667)](https://packagist.org/packages/bugbuster/mobiledetection) [![Total Downloads](https://camo.githubusercontent.com/1f2ad5555b373103afdafc705b1751f4950079016084668546c87b71dd06851a/68747470733a2f2f706f7365722e707567782e6f72672f6275676275737465722f6d6f62696c65646574656374696f6e2f646f776e6c6f6164732e737667)](https://packagist.org/packages/bugbuster/mobiledetection) [![Latest Unstable Version](https://camo.githubusercontent.com/9516812be08da7469f053a47dd762e09704f36e0cc6bf6f64af4e2b4e8c48b6c/68747470733a2f2f706f7365722e707567782e6f72672f6275676275737465722f6d6f62696c65646574656374696f6e2f762f756e737461626c652e737667)](https://packagist.org/packages/bugbuster/mobiledetection) [![License](https://camo.githubusercontent.com/b21d70eb2bf8ce3d075c62c94d3110d4b1296bb57633ab6f1ee88ad6053033f6/68747470733a2f2f706f7365722e707567782e6f72672f6275676275737465722f6d6f62696c65646574656374696f6e2f6c6963656e73652e737667)](https://packagist.org/packages/bugbuster/mobiledetection)

About
-----

[](#about)

Contao 3 Module "Mobile-Detection", based on ""

Helperclasses for developer. Demo frontend module is present.

Installation
------------

[](#installation)

### Manually

[](#manually)

- Do not use the ZIP file from GitHub! Use the ER2 [mobiledetection](https://contao.org/en/extension-list/view/mobiledetection.html)

### Over Composer

[](#over-composer)

- Search for [bugbuster/mobiledetection](https://packagist.org/packages/bugbuster/mobiledetection), version &gt;= 3.5
- composer loads additionally "mobiledetect/mobiledetectlib" version 2.\*

Hooks help!
-----------

[](#hooks-help)

A Hook add a special class to page css class (in body tag):

- phone : mobile device, but no tablet
- tablet : mobile device and a tablet
- computer : no mobile device, no tablet

Examples
--------

[](#examples)

Galaxy S II (Phone)

- ``

Motorola Xoom (Tablet)

- ``

Linux Mint PC (Computer)

- ``

Usage the Classes
-----------------

[](#usage-the-classes)

You have two options:

- You're using the original class (Detection\\MobileDetect).
- You're using the wrapper class (MobileDetection\\Mobile\_Detection).

### Mobile\_Detect (original class)

[](#mobile_detect-original-class)

#### ER2 version (without a namespace of the original class)

[](#er2-version-without-a-namespace-of-the-original-class)

```
include '/Mobile_Detect.php';

$detect = new Mobile_Detect();
```

Continue as described in the next section.

#### Composer version (with a namespace of the original class)

[](#composer-version-with-a-namespace-of-the-original-class)

```
use Detection\MobileDetect;

$detect = new MobileDetect();

// Check for any mobile device.
if ($detect->isMobile())

// Check for any tablet.
if($detect->isTablet())

// Check for any mobile device, excluding tablets.
if ($detect->isMobile() && !$detect->isTablet())
```

For the full list of available methods check the directory [![examples](https://github.com/serbanghita/Mobile-Detect)](https://github.com/serbanghita/Mobile-Detect).

### Mobile\_Detection (wrapper class)

[](#mobile_detection-wrapper-class)

```
$this->import('\MobileDetection\Mobile_Detection','Mobile_Detection');

// Check device type
echo $this->Mobile_Detection->getDeviceType(); // phone|tablet|computer

// Check for any mobile device.
if ($this->Mobile_Detection->isMobile())

// Check for any tablet.
if ($this->Mobile_Detection->isTablet())

// Check mobile grade
echo $this->Mobile_Detection->getMobileGrade(); // A|B|C

// Check mobile rules
$arrRules = $this->Mobile_Detection->getMobileRules();
// result e.g. array('SamsungTablet','AndroidOS','Safari')
```

See demo module "MobileDetectionDemo".

###  Health Score

23

—

LowBetter than 27% of packages

Maintenance0

Infrequent updates — may be unmaintained

Popularity12

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity62

Established project with proven stability

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~89 days

Total

5

Last Release

4217d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/497111?v=4)[Anton Safonov](/maintainers/BugBuster)[@BugBuster](https://github.com/BugBuster)

---

Top Contributors

[![BugBuster1701](https://avatars.githubusercontent.com/u/1218809?v=4)](https://github.com/BugBuster1701 "BugBuster1701 (41 commits)")

---

Tags

phonemobilecontaodetectiontablet

### Embed Badge

![Health badge](/badges/bugbuster-mobiledetection/health.svg)

```
[![Health](https://phpackages.com/badges/bugbuster-mobiledetection/health.svg)](https://phpackages.com/packages/bugbuster-mobiledetection)
```

###  Alternatives

[hisorange/browser-detect

Browser &amp; Mobile detection package for Laravel.

1.1k10.1M50](/packages/hisorange-browser-detect)[alexandernst/yii2-device-detect

Yii2 extension for Mobile-Detect library

141846.2k3](/packages/alexandernst-yii2-device-detect)[riverskies/laravel-mobile-detect

Instant mobile detection access directly from within Blade templates.

2361.4M7](/packages/riverskies-laravel-mobile-detect)[codefog/contao-mobile_menu

mobile\_menu extension for Contao Open Source CMS

1439.7k](/packages/codefog-contao-mobile-menu)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
