2017 © Pedro Peláez
 

yii2-extension yii2-device-detect

Yii2 extension for Mobile-Detect library

image

alikdex/yii2-device-detect

Yii2 extension for Mobile-Detect library

  • Wednesday, August 3, 2016
  • by AlikDex
  • Repository
  • 2 Watchers
  • 2 Stars
  • 93 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 2 Versions
  • 21 % Grown

The README.md

yii2-device-detect

Yii2 extension for Mobile-Detect library., (*1)

To use it just require this extension in your composer.json file:, (*2)

"alikdex/yii2-device-detect": "0.0.1",

And then add it to your components configuration in Yii2:, (*3)

'bootstrap' => ['devicedetect'],
'components' => [
    'devicedetect' => [
        'class' => 'alikdex\devicedetect\DeviceDetect'
    ],
]

Some basic detections are available in Yii's params:, (*4)

var_dump(Yii::$app->params['devicedetect']);

array (size=3)
  'isMobile' => boolean false
  'isTablet' => boolean false
  'isDesktop' => boolean true

You can also use it from anywhere in your code, calling Mobile-Detect's API:, (*5)

/*Detect a mobile device*/
\Yii::$app->devicedetect->isMobile();

/*Detect a tablet device*/
\Yii::$app->devicedetect->isTablet();

/*Check all available methods here: http://demo.mobiledetect.net/ */

The Versions

03/08 2016

dev-master

9999999-dev

Yii2 extension for Mobile-Detect library

  Sources   Download

MIT License

The Requires

 

by Alik Dexor

extension yii2 mobile phone detect desktop device tablet

03/08 2016

0.0.1

0.0.1.0

Yii2 extension for Mobile-Detect library

  Sources   Download

MIT License

The Requires

 

by Alik Dexor

extension yii2 mobile phone detect desktop device tablet