PHPackages                             alexandernst/yii2-device-detect - 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. alexandernst/yii2-device-detect

ActiveYii2-extension

alexandernst/yii2-device-detect
===============================

Yii2 extension for Mobile-Detect library

0.0.12(8y ago)141846.2k↓10.1%37[2 issues](https://github.com/alexandernst/yii2-device-detect/issues)3GNU General Public License v3PHP

Since Mar 25Pushed 5y ago10 watchersCompare

[ Source](https://github.com/alexandernst/yii2-device-detect)[ Packagist](https://packagist.org/packages/alexandernst/yii2-device-detect)[ RSS](/packages/alexandernst-yii2-device-detect/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (4)Dependencies (2)Versions (13)Used By (3)

yii2-device-detect
==================

[](#yii2-device-detect)

Yii2 extension for [Mobile-Detect](https://github.com/serbanghita/Mobile-Detect) library.

To use it just require this extension in your `composer.json` file:

```
"alexandernst/yii2-device-detect": "0.0.12",

```

And then add it to your components configuration in Yii2:

```
'bootstrap' => ['devicedetect'],
'components' => [
	'devicedetect' => [
		'class' => 'alexandernst\devicedetect\DeviceDetect'
	],
]
```

Some basic detections are available in Yii's `params`:

```
var_dump(Yii::$app->params['devicedetect']);

array (size=3)
  'isMobile' => boolean false
  'isTablet' => boolean false
  'isDesktop' => boolean true
```

You can also use it from anywhere in your code, calling Mobile-Detect's API:

```
/*Detect a mobile device*/
\Yii::$app->devicedetect->isMobile();

/*Detect a tablet device*/
\Yii::$app->devicedetect->isTablet();

/*Check all available methods here: http://demo.mobiledetect.net/ */
```

Or using the an alias:

```
\Yii::getAlias('@device'); //return 'mobile', 'tablet' or 'desktop'.
```

###  Health Score

43

—

FairBetter than 91% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity55

Moderate usage in the ecosystem

Community25

Small or concentrated contributor base

Maturity60

Established project with proven stability

 Bus Factor1

Top contributor holds 85.3% 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 ~78 days

Recently: every ~214 days

Total

12

Last Release

3206d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/617ea779011249f99b5d6486b33df7bf1ae2e2121f76354a0ad6e1c4fb076dc6?d=identicon)[alexandernst](/maintainers/alexandernst)

---

Top Contributors

[![alexandernst](https://avatars.githubusercontent.com/u/89727?v=4)](https://github.com/alexandernst "alexandernst (29 commits)")[![de-salvatierra](https://avatars.githubusercontent.com/u/5816848?v=4)](https://github.com/de-salvatierra "de-salvatierra (2 commits)")[![ilyapoz](https://avatars.githubusercontent.com/u/6518631?v=4)](https://github.com/ilyapoz "ilyapoz (2 commits)")[![love-bhardwaj](https://avatars.githubusercontent.com/u/69479854?v=4)](https://github.com/love-bhardwaj "love-bhardwaj (1 commits)")

---

Tags

phonemobiledesktopyii2extensionwidgetdevicedetecttablet

### Embed Badge

![Health badge](/badges/alexandernst-yii2-device-detect/health.svg)

```
[![Health](https://phpackages.com/badges/alexandernst-yii2-device-detect/health.svg)](https://phpackages.com/packages/alexandernst-yii2-device-detect)
```

###  Alternatives

[richardfan1126/yii2-js-register

Yii2 widget to register JS into view

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

PHPackages © 2026

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