dev-master
9999999-dev https://github.com/lulubin/yii2-component-devicedetectAn Yii2 component for detect device
BSD 3-Clause
The Requires
by lulubin
component extension yii2 widget mobile phone detect desktop device tablet
An Yii2 component for detect device
composer require --prefer-dist lulubin/yii2-component-devicedetect "dev-master", (*1)
'bootstrap' => ['devicedetect'], 'components' => [ 'devicedetect' => [ 'class' => 'lulubin\devicedetect\DeviceDetect' ], ]
var_dump(Yii::$app->params['devicedetect']); array (size=3) 'isMobile' => boolean false 'isTablet' => boolean false 'isDesktop' => boolean true
var_dump(Yii::$app->devicedetect->isMobile()); var_dump(Yii::$app->devicedetect->isTablet()); /*Check all available methods here: http://demo.mobiledetect.net/ */
var_dump(Yii::getAlias('@device')); //return 'mobile', 'tablet' or 'desktop'
An Yii2 component for detect device
BSD 3-Clause
component extension yii2 widget mobile phone detect desktop device tablet