Состав платформы
Определение устройства
Определение мобильных устройств и планшетов.
Установка
Подключите пакет в корне проекта на SkeekS Платформе, затем примените миграции проекта.
composer require skeeks/yii2-mobile-detect
Зависимости
Инструкция из репозитория
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.
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
Add
mobileDetectcomponent to your Yii2 configuration like this:'components' => [ 'mobileDetect' => [ 'class' => '\skeeks\yii2\mobiledetect\MobileDetect' ] ]Use
mobileDetectcomponent 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!
skeeks.com | cms.skeeks.com
Поддержка
Вопросы по установке и работе решения можно задать командой SkeekS или завести обращение в репозитории.
Обновления
v1.0.2

