ezze / yii2-mobile-detect
There is no license information available for the latest version (0.1.0) of this package.
Yii2 component used to detect mobile devices
Package info
github.com/ezze/yii2-mobile-detect
Type:yii2-extension
pkg:composer/ezze/yii2-mobile-detect
0.1.0
2015-04-08 20:59 UTC
Requires
- mobiledetect/mobiledetectlib: 2.8.*
- yiisoft/yii2: *
This package is not auto-updated.
Last update: 2026-03-21 03:50:24 UTC
README
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.
Installation
The preferred way to install this extension is through Composer.
Either run
php composer.phar require --prefer-dist ezze/yii2-mobile-detect
or add
"ezze/yii2-mobile-detect": "~0.1.0"
to the require section of your composer.json file.
Usage
-
Add
mobileDetectcomponent to your Yii2 configuration like this:'components' => [ 'mobileDetect' => [ 'class' => '\ezze\yii2\mobiledetect\MobileDetect' ] ]
-
Use
mobileDetectcomponent as Mobile_Detect PHP class:echo \Yii::$app->mobileDetect->isMobile();