PHPackages                             xstreamka/yii2-mobile-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. [Utility &amp; Helpers](/categories/utility)
4. /
5. xstreamka/yii2-mobile-detect

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

xstreamka/yii2-mobile-detect
============================

Mobile\_Detect class for Yii2 with the ability to add new devices.

v1.1(1y ago)115.7k↑110%2MITPHP

Since Nov 2Pushed 1y ago1 watchersCompare

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

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

Device detect for Yii2
======================

[](#device-detect-for-yii2)

Mobile\_Detect class for Yii2 with the ability to add new devices.

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

[](#installation)

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

Either run

```
php composer.phar require --prefer-dist xstreamka/yii2-mobile-detect "*"

```

or add

```
"xstreamka/yii2-mobile-detect": "*"

```

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

Usage
-----

[](#usage)

Once the extension is installed, simply use it in your code by:

```
xstreamka\mobiledetect\Device::$isPhone;
```

Add new device (your list of devices)
-------------------------------------

[](#add-new-device-your-list-of-devices)

Configure the component in your configuration file (`frontend/config/main.php`):

```
'components' => [
    ...
    'device' => [
        'class' => 'xstreamka\mobiledetect\Device',
        'tablet' => ['SM-T975'], // Array of users' tablets devices.
        'phone' => [] // Array of users' phone devices.
    ],
    ...
]
```

Tools
-----

[](#tools)

```
Device::$isMobile;  // Mobile: Tablet or Phone.
Device::$isTablet;  // Tablet
Device::$isPhone;   // Phone
Device::$isIphone;  // iPhone
Device::$isSamsung; // Samsung
Device::$info;      // About device (HTTP_USER_AGENT)

// Device::$detect === Mobile_Detect()
Device::$detect->isTablet();
Device::$detect->isMobile();
...
Device::$detect->isiOS();
// more here: https://github.com/serbanghita/Mobile-Detect/wiki/Code-examples
```

Example
-------

[](#example)

```

Hello World
...

text for phone devices

text for tablet devices

text for other devices

...
```

###  Health Score

35

—

LowBetter than 79% of packages

Maintenance31

Infrequent updates — may be unmaintained

Popularity29

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity55

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 75% 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 ~1287 days

Total

2

Last Release

729d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/65388d46c1892d0c236d0734edf97452d75b67611f38ebae874a3e93c6fb87db?d=identicon)[XStream](/maintainers/XStream)

---

Top Contributors

[![xstreamka](https://avatars.githubusercontent.com/u/73387820?v=4)](https://github.com/xstreamka "xstreamka (3 commits)")[![liviuk2](https://avatars.githubusercontent.com/u/11991766?v=4)](https://github.com/liviuk2 "liviuk2 (1 commits)")

---

Tags

mobile detectyii2extensiondevicedetect

### Embed Badge

![Health badge](/badges/xstreamka-yii2-mobile-detect/health.svg)

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

###  Alternatives

[alexandernst/yii2-device-detect

Yii2 extension for Mobile-Detect library

141846.2k3](/packages/alexandernst-yii2-device-detect)[dmstr/yii2-cookie-consent

Yii2 Cookie Consent Widget

1452.6k](/packages/dmstr-yii2-cookie-consent)[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)
