ezze/yii2-mobile-detect

There is no license information available for the latest version (0.1.0) of this package.

Yii2 component used to detect mobile devices

Installs: 48 129

Dependents: 1

Suggesters: 0

Security: 0

Stars: 1

Watchers: 3

Forks: 0

Open Issues: 0

Type:yii2-extension

0.1.0 2015-04-08 20:59 UTC

This package is not auto-updated.

Last update: 2024-11-01 21:15:50 UTC


README

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 ezze/yii2-mobile-detect

or add

"ezze/yii2-mobile-detect": "~0.1.0"

to the require section of your composer.json file.

Usage

  1. Add mobileDetect component to your Yii2 configuration like this:

    'components' => [
        'mobileDetect' => [
            'class' => '\ezze\yii2\mobiledetect\MobileDetect'
        ]
    ]
  2. Use mobileDetect component as Mobile_Detect PHP class:

    echo \Yii::$app->mobileDetect->isMobile();