Download the PHP package thormeier/mobile-detect-light-bundle without Composer
On this page you can find all versions of the php package thormeier/mobile-detect-light-bundle. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Table of contents
Download thormeier/mobile-detect-light-bundle
More information about thormeier/mobile-detect-light-bundle
Files in thormeier/mobile-detect-light-bundle
Download thormeier/mobile-detect-light-bundle
More information about thormeier/mobile-detect-light-bundle
Files in thormeier/mobile-detect-light-bundle
Vendor thormeier
Package mobile-detect-light-bundle
Short Description Symfony2 bundle for easy usage of mobiledetect class in Twig http://mobiledetect.net/
License MIT
Package mobile-detect-light-bundle
Short Description Symfony2 bundle for easy usage of mobiledetect class in Twig http://mobiledetect.net/
License MIT
Please rate this library. Is it a good library?
Informations about the package mobile-detect-light-bundle
MobileDetectLightBundle
Introduction
This Symfony2 bundle provides three twig functions to check if the client is on a mobile or tablet device. This bundle makes use of the class provided by http://mobiledetect.net/. This bundle is built to be as lightweight as possible to provide a possibility to alter Twig templates according to the clients device.
Installation
Step 1: Composer require
$ php composer.phar require "thormeier/mobile-detect-light-bundle":"1.0.*"
Step2: Enable the bundle in the kernel
<?php
// app/AppKernel.php
public function registerBundles()
{
$bundles = array(
// ...
new Thormeier\MobileDetectLightBundle\ThormeierMobileDetectLightBundle(),
// ...
);
}
Usage
There are three new Twig functions provided by this bundle:
is_mobile()
// template.html.twig
{% if is_mobile() %}
{# do something that is only visible for mobile users, i.e. display an app store button or similar #}
{% endif %}
is_tablet()
// template.html.twig
{% if is_tablet() %}
{# do something for tablet users only #}
{% endif %}
is_desktop()
// template.html.twig
{% if is_desktop() %}
{# do something for desktop users only #}
{% endif %}
All versions of mobile-detect-light-bundle with dependencies
PHP Build Version
Package Version
Requires
php Version
>=5.3.3
symfony/framework-bundle Version 2.*
mobiledetect/mobiledetectlib Version 2.*
symfony/framework-bundle Version 2.*
mobiledetect/mobiledetectlib Version 2.*
The package thormeier/mobile-detect-light-bundle contains the following files
Loading the files please wait ....