2017 © Pedro Peláez
 

yii2-extension mobiledetector

Yii2 extension for Mobile-Detect library

image

gulltour/mobiledetector

Yii2 extension for Mobile-Detect library

  • Friday, March 17, 2017
  • by weijiansdlx
  • Repository
  • 1 Watchers
  • 0 Stars
  • 61 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 3 Versions
  • 2 % Grown

The README.md

MobileDetector

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

Mobile detector

Detect type of device by information from request., (*2)

Notes

This extension based on mobiledetect project http://mobiledetect.net/., (*3)

See [here] (http://demo.mobiledetect.net/) for more documentation and examples., (*4)

Installation

The preferred way to install this extension is through composer., (*5)

Either run, (*6)

php composer.phar require --prefer-dist gulltour/mobiledetector "*"

or add, (*7)

"gulltour/mobiledetector": "*"

to the require section of your composer.json file., (*8)

Usage

Update config file config/web.php or common/main.php:, (*9)

return [
    ...
    'components' => [
        'mobiledetect' => [
            'class' => 'gulltour\mobiledetect\MobileDetect',
        ],
    ],
    ...
];

Set event handler for detect type of device before run Application, (*10)

// path/to/web/index.php
$application = new yii\web\Application($config);

Yii::$app->on(\yii\base\Application::EVENT_BEFORE_REQUEST,function($event){
    Yii::$app->params['detect'] = [
        'isMobile' => Yii::$app->mobiledetect->isMobile(),
        'isTablet' => Yii::$app->mobiledetect->isTablet(),
    ];
});

$application->run();

The Versions

17/03 2017

dev-master

9999999-dev https://github.com/weijiansdlx/mobiledetector

Yii2 extension for Mobile-Detect library

  Sources   Download

GPL-3.0+

The Requires

 

extension yii2 widget mobile phone detect desktop device tablet

17/03 2017

1.0.2

1.0.2.0 https://github.com/weijiansdlx/mobiledetector

Yii2 extension for Mobile-Detect library

  Sources   Download

GPL-3.0+

The Requires

 

extension yii2 widget mobile phone detect desktop device tablet

17/03 2017

1.0.0

1.0.0.0 https://github.com/weijiansdlx/mobiledetector

Yii2 extension for Mobile-Detect library

  Sources   Download

GPL-3.0+

The Requires

 

extension yii2 widget mobile phone detect desktop device tablet