Mobile Detect extension for Yii2

Installs: 181 206

Dependents: 2

Suggesters: 0

Security: 0

Stars: 3

Watchers: 2

Forks: 5

Open Issues: 0


1.0.2 2019-07-19 07:06 UTC

This package is auto-updated.

Last update: 2023-05-19 15:21:02 UTC


This extension provides an Yii2 component wrapper for Mobile_Detect PHP class and can be used to detect whether a device is mobile one in your Yii2 application.

Latest Stable Version Total Downloads


The preferred way to install this extension is through Composer.

Either run

php composer.phar require --prefer-dist skeeks/yii2-mobile-detect

or add

"skeeks/yii2-mobile-detect": "^1.0.2"

to the require section of your composer.json file.


  1. Add mobileDetect component to your Yii2 configuration like this:

    'components' => [
        'mobileDetect' => [
            'class' => '\skeeks\yii2\mobiledetect\MobileDetect'
  2. Use mobileDetect component as Mobile_Detect PHP class:

    echo \Yii::$app->mobileDetect->isMobile();
    echo \Yii::$app->mobileDetect->isTablet();
    echo \Yii::$app->mobileDetect->isDesctop();
    //version >= 1.0.1
    echo \skeeks\yii2\mobiledetect\MobileDetect::getInstance()->isMobile();

SkeekS CMS (Yii2) — quickly, easily and effectively! |