Skip to content

A mobile detect ServiceProvider for Silex, based on Mobile-Detect library.

License

Notifications You must be signed in to change notification settings

pudovmaxim/MobileDetectServiceProvider

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

19 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

MobileDetectServiceProvider

A mobile detect ServiceProvider for Silex, based on Mobile-Detect library.

Fetch

The recommended way to install MobileDetectServiceProvider is through composer.

Just create a composer.json file for your project:

{
    "require": {
        "jbinfo/mobile-detect-service-provider": "~2",
        "silex/silex": "~2"
    }
}

Register

use Silex\Application;
use Binfo\Silex\MobileDetectServiceProvider;

$app = new Application();

$app->register(new MobileDetectServiceProvider());

Usage

if ($app["mobile_detect"]->isMobile()) {
    echo "Mobile device";
    
} else {
    echo "Desktop device";
}
echo $app["mobile_detect"]->version('iPad');

For more informations check the website of Mobile-Detect library.

Bitdeli Badge

About

A mobile detect ServiceProvider for Silex, based on Mobile-Detect library.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • PHP 100.0%