PHPackages                             gulltour/mobiledetector - 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. gulltour/mobiledetector

ActiveYii2-extension[Utility &amp; Helpers](/categories/utility)

gulltour/mobiledetector
=======================

Yii2 extension for Mobile-Detect library

1.0.2(9y ago)071GPL-3.0+PHP

Since Mar 17Pushed 9y ago1 watchersCompare

[ Source](https://github.com/weijiansdlx/mobiledetector)[ Packagist](https://packagist.org/packages/gulltour/mobiledetector)[ Docs](https://github.com/weijiansdlx/mobiledetector)[ RSS](/packages/gulltour-mobiledetector/feed)WikiDiscussions master Synced 3w ago

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

MobileDetector
==============

[](#mobiledetector)

Yii2 extension for Mobile-Detect library Mobile detector
========================================================

[](#yii2-extension-for-mobile-detect-librarymobile-detector)

Detect type of device by information from request.

Notes
-----

[](#notes)

This extension based on mobiledetect project .

See \[here\] () for more documentation and examples.

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

[](#installation)

The preferred way to install this extension is through [composer](http://getcomposer.org/download/).

Either run

```
php composer.phar require --prefer-dist gulltour/mobiledetector "*"

```

or add

```
"gulltour/mobiledetector": "*"

```

to the require section of your `composer.json` file.

Usage
-----

[](#usage)

Update config file *config/web.php* or *common/main.php*:

```
return [
    ...
    'components' => [
        'mobiledetect' => [
            'class' => 'gulltour\mobiledetect\MobileDetect',
        ],
    ],
    ...
];
```

Set event handler for detect type of device before run Application

```
// path/to/web/index.php
$application = new yii\web\Application($config);

Yii::$app->on(\yii\base\Application::EVENT_BEFORE_REQUEST,function($event){
    Yii::$app->params['detect'] = [
        'isMobile' => Yii::$app->mobiledetect->isMobile(),
        'isTablet' => Yii::$app->mobiledetect->isTablet(),
    ];
});

$application->run();
```

###  Health Score

27

—

LowBetter than 47% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity8

Limited adoption so far

Community4

Small or concentrated contributor base

Maturity64

Established project with proven stability

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

Total

2

Last Release

3391d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/84a23608e387141f01266a1cc68e51784c78fd5e45f23d0e7a9ac56be890c6e9?d=identicon)[weijiansdlx](/maintainers/weijiansdlx)

---

Tags

phonemobiledesktopyii2extensionwidgetdevicedetecttablet

### Embed Badge

![Health badge](/badges/gulltour-mobiledetector/health.svg)

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

###  Alternatives

[alexandernst/yii2-device-detect

Yii2 extension for Mobile-Detect library

135865.7k3](/packages/alexandernst-yii2-device-detect)[richardfan1126/yii2-js-register

Yii2 widget to register JS into view

1358.5k7](/packages/richardfan1126-yii2-js-register)

PHPackages © 2026

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