Giter Club home page Giter Club logo

mobiledetectbundle's Introduction

Mobile Detect

MobileDetectBundle

Symfony 3.4.x-6.0.x bundle to detect mobile devices, manage mobile view and redirect to the mobile and tablet version.

Github Actions Status Latest Stable Version Total Downloads codecov License PHP Version Require

This bundle is a fork of suncat2000/MobileDetectBundle. As this project doesn't look maintained anymore, we decided to create & maintain a fork. For more information read our manifest.

Introduction

This Bundle use Mobile_Detect class and provides the following features:

  • Detect the various mobile devices by Name, OS, browser User-Agent
  • Manages site views for the various mobile devices (mobile, tablet, full)
  • Redirects to mobile and tablet sites

Documentation

Installation

composer require tattali/mobile-detect-bundle

Install with Symfony legacy versions: here

Usage

Checking device

use MobileDetectBundle\DeviceDetector\MobileDetectorInterface;

public function someaction(MobileDetectorInterface $mobileDetector)
{
    $mobileDetector->isMobile();
    $mobileDetector->isTablet();
    $mobileDetector->is('iPhone');
}

With Twig

{% if is_mobile() %}
{% if is_tablet() %}
{% if is_device('iPhone') %} # magic methods is[...]

Switch device view

For switch device view, use device_view GET parameter:

http://localhost:8000?device_view={full/mobile/tablet}

Or using the Symfony toolbar mbd-bundle-sf-toolbar

Going further

Contribute and feedback

Any feedback and contribution will be very appreciated.

License and credits

This bundle is under the MIT license. See the complete license in the bundle

Original authors: suncat2000, HenriVesala, netmikey and all contributors

mobiledetectbundle's People

Contributors

tattali avatar suncat2000 avatar henrivesala avatar netmikey avatar felp302 avatar bocharsky-bw avatar ricoli avatar erivello avatar ninir avatar xabbuh avatar jonashaouzi avatar trq avatar alexhoma avatar sfdumi avatar nicolasbadey avatar emarref avatar kerihenare avatar juulrecognize avatar iamdey avatar netbull avatar steorangeball23 avatar mhlavac avatar lxregistry avatar ericlery avatar notrix avatar sgrodzicki avatar romaricdrigon avatar rolfbabijn avatar oliboy50 avatar mablae avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.