skeeks/yii2-mobile-detect Mobile Detect extension for Yii2

extensionmobiledetect

Mobile Detect extension for Yii2

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

Installation

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.

Usage

  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!
SkeekS CMS (Yii2) — quickly, easily and effectively!
skeeks.com | cms.skeeks.com

Changelog

Процесс разработки

1.0.2

1.0.1

  • Добавлен новый метод \skeeks\yii2\mobiledetect\MobileDetect::getInstance()
  • Исправлена кодировка файлов на utf-8

1.0.0

  • Начало

Statistics

Downloads
GitHub Stars
GitHub Forks

Releases

Comments



1.0.2 is the latest of 3 releases



BSD-3-Clause license
Stats
3 github stars & 6 github forks
127 downloads in the last day
2391 downloads in the last 30 days
205388 total downloads