PHPackages                             bugbuster/contao-mobiledetection-bundle - 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. [Utility &amp; Helpers](/categories/utility)
4. /
5. bugbuster/contao-mobiledetection-bundle

AbandonedArchivedContao-bundle[Utility &amp; Helpers](/categories/utility)

bugbuster/contao-mobiledetection-bundle
=======================================

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

1.0.2(5y ago)19.6k[1 issues](https://github.com/BugBuster1701/contao-mobiledetection-bundle/issues)1LGPL-3.0-or-laterPHPPHP ^7.2 || ^8.0

Since Feb 13Pushed 5y ago1 watchersCompare

[ Source](https://github.com/BugBuster1701/contao-mobiledetection-bundle)[ Packagist](https://packagist.org/packages/bugbuster/contao-mobiledetection-bundle)[ Docs](http://contao.ninja)[ RSS](/packages/bugbuster-contao-mobiledetection-bundle/feed)WikiDiscussions master Synced 1w ago

READMEChangelogDependencies (3)Versions (4)Used By (1)

Contao 4 Bundle "Mobile-Detection"
==================================

[](#contao-4-bundle-mobile-detection)

[![Latest Stable Version](https://camo.githubusercontent.com/5f9367f73b5d8c0ebec712f55be96c3efba1708732d005f785a3a594b361e88b/68747470733a2f2f706f7365722e707567782e6f72672f6275676275737465722f636f6e74616f2d6d6f62696c65646574656374696f6e2d62756e646c652f762f737461626c652e737667)](https://packagist.org/packages/bugbuster/contao-mobiledetection-bundle)[![Total Downloads](https://camo.githubusercontent.com/5c724c0ffddbf4eee31d0145de747c852189653a7e1f04915067f0144e175649/68747470733a2f2f706f7365722e707567782e6f72672f6275676275737465722f636f6e74616f2d6d6f62696c65646574656374696f6e2d62756e646c652f646f776e6c6f6164732e737667)](https://packagist.org/packages/bugbuster/contao-mobiledetection-bundle)[![Latest Unstable Version](https://camo.githubusercontent.com/16022a82c92320113c42a027662c5ac74906eed911fb7bd79af78337424cc735/68747470733a2f2f706f7365722e707567782e6f72672f6275676275737465722f636f6e74616f2d6d6f62696c65646574656374696f6e2d62756e646c652f762f756e737461626c652e737667)](https://packagist.org/packages/bugbuster/contao-mobiledetection-bundle)[![License](https://camo.githubusercontent.com/3784d98d72334bb190493e483f3f949bb0c4173bc9cc1a407f4d17ff93bd05c0/68747470733a2f2f706f7365722e707567782e6f72672f6275676275737465722f636f6e74616f2d6d6f62696c65646574656374696f6e2d62756e646c652f6c6963656e73652e737667)](https://packagist.org/packages/bugbuster/contao-mobiledetection-bundle)

[![Codacy Badge](https://camo.githubusercontent.com/f805384ee4cf0fff468b045593212501cec9f1da7ea381387f11fc71eb43917c/68747470733a2f2f6170692e636f646163792e636f6d2f70726f6a6563742f62616467652f47726164652f3035636232343062363038383466626562356231336661623435363636326661)](https://www.codacy.com/app/BugBuster1701/contao-mobiledetection-bundle?utm_source=github.com&utm_medium=referral&utm_content=BugBuster1701/contao-mobiledetection-bundle&utm_campaign=Badge_Grade)

About
-----

[](#about)

Contao 4 Bundle "Mobile-Detection", based on ""

Helperclasses for developer. Demo frontend module is present.

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

[](#installation)

### With Contao Manager

[](#with-contao-manager)

- Search for [bugbuster/contao-mobiledetection-bundle](https://packagist.org/packages/bugbuster/contao-mobiledetection-bundle)
- Composer loads additionally "mobiledetect/mobiledetectlib" version 2.\*

### With Composer

[](#with-composer)

- `composer require bugbuster/contao-mobiledetection-bundle`
- 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 (BugBuster\\MobileDetection\\Mobile\_Detection).

### Mobile\_Detect (original class)

[](#mobile_detect-original-class)

#### 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)

```
use BugBuster\MobileDetection\Mobile_Detection;
...
$this->Mobile_Detection = new 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

29

—

LowBetter than 59% of packages

Maintenance0

Infrequent updates — may be unmaintained

Popularity22

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity70

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 ~537 days

Total

3

Last Release

1942d ago

PHP version history (2 changes)1.0.0PHP ^5.6|^7.0

1.0.2PHP ^7.2 || ^8.0

### 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 (8 commits)")

---

Tags

phonemobilecontaodetectiontablet

### Embed Badge

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

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

###  Alternatives

[hisorange/browser-detect

Browser &amp; Mobile detection package for Laravel.

1.1k10.1M50](/packages/hisorange-browser-detect)[wolfcast/browser-detection

The Wolfcast BrowserDetection PHP class facilitates the identification of the user's environment such as Web browser, version, platform family, platform version or if it's a mobile device or not.

1391.0M7](/packages/wolfcast-browser-detection)[alexandernst/yii2-device-detect

Yii2 extension for Mobile-Detect library

141846.2k3](/packages/alexandernst-yii2-device-detect)[codefog/contao-haste

haste extension for Contao Open Source CMS

42650.8k139](/packages/codefog-contao-haste)[madeyourday/contao-rocksolid-custom-elements

Create your own, nestable content elements using a modular system. End the WYSIWYG chaos with your own content elements.

50341.9k12](/packages/madeyourday-contao-rocksolid-custom-elements)[dklemmt/contao_dk_mmenu

Implementation of mmenu as an extension for the Contao Open Source CMS.

1578.7k](/packages/dklemmt-contao-dk-mmenu)

PHPackages © 2026

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