2017 © Pedro Peláez
 

symfony-bundle mdetect-bundle

Mobile device detector bundle for Symfony2 (MDetect Wrapper)

image

teckhouse/mdetect-bundle

Mobile device detector bundle for Symfony2 (MDetect Wrapper)

  • Thursday, October 3, 2013
  • by Mauro Foti
  • Repository
  • 2 Watchers
  • 0 Stars
  • 203 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 1 Versions
  • 0 % Grown

The README.md

Installation

Add TeckHouseMDetectBundle in your composer.json:

{
    "require": {
        "teckhouse/mdetect-bundle": "dev-master"
    }
}

Install the bundle with composer:

$ php composer.phar update teckhouse/mdetect-bundle

Enable the bundle

<?php
// app/AppKernel.php

public function registerBundles()
{
    $bundles = array(

        // Yours bundles
        // [...] 

        // Mobile Detect Bundle
        new TeckHouse\MDetectBundle\TeckHouseMDetectBundle(),
    );
}

Configure

there is only one parameter :), (*1)

in config.yml:, (*2)

teckhouse_mdetect:
    inject_value: [ true | false ]

Usage

if the injection in request is setted to true you will find the var "$userDeviceType" in request parameters bug that indentify the device type: "mobile", "tablet", "desk"., (*3)

To get the value simple do this:, (*4)

$request->server->get("userDeviceType");

If the injection is setted to "off" you can use the service to get infos about the device:, (*5)

$this->get('teckhouse_mdetect.wrapper');

In any case you can use Twig filter extension to retrive the status in template:, (*6)

{{ getDeviceType() }}

The Versions

03/10 2013

dev-master

9999999-dev https://github.com/TeckHouse/MDetectBundle

Mobile device detector bundle for Symfony2 (MDetect Wrapper)

  Sources   Download

MIT

The Requires

  • php >=5.3.2

 

The Development Requires

by Avatar Mauro Foti

mobile device detect mdetect