2017 © Pedro Peláez
 

library mobile-detect-module

ZF Module which facilitates integration of a PHP MobileDetect library

image

nikolaposa/mobile-detect-module

ZF Module which facilitates integration of a PHP MobileDetect library

  • Sunday, July 2, 2017
  • by nikolaposa
  • Repository
  • 4 Watchers
  • 8 Stars
  • 13,459 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 2 Forks
  • 0 Open issues
  • 4 Versions
  • 3 % Grown

The README.md

MobileDetectModule

![Build Status][ico-build] ![Code Quality][ico-code-quality] Code Coverage Latest Version, (*1)

ZF module which facilitates integration of a PHP MobileDetect library (http://mobiledetect.net)., (*2)

Installation

The preferred method of installation is via Composer. Run the following command to install the latest version of a package and add it to your project's composer.json:, (*3)

composer require nikolaposa/mobile-detect-module

Enable the module in your application.config.php:

<?php
return [
    'modules' => [
        // ...
        'MobileDetectModule',
    ],
    // ...
];

Features

  • Factory for creating MobileDetect service
  • View helper and controller plugin for providing easier access to the MobileDetect service

Usage

MobileDetect service

The actual Mobile_Detect class instance will be available under the MobileDetect service. Refer to the Mobile Detect project documenation for more information about its features., (*4)

$mobileDetect = $container->get('MobileDetect'); //Detection\MobileDetect instance

if ($mobileDetect->isMobile()) {
    //do something
}

View helper

View helper - mobileDetect is available for providing access to the MobileDetect service on the view layer:, (*5)

echo $this->mobileDetect()->version('Android');

Controller plugin

Controller plugin - mobileDetect is available for providing access to the MobileDetect service on the controller layer:, (*6)

if ($this->mobileDetect()->isTablet()) {
    //do something
}

Credits

License

Released under MIT License - see the License File for details., (*7)

The Versions