PHPackages                             yan/device-detector-bundle - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. yan/device-detector-bundle

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

yan/device-detector-bundle
==========================

Symfony2 bundle for detecting devices and directing them to correct controllers.

v1.0.2(10y ago)1123MITPHPPHP &gt;=5.3.0

Since Feb 1Pushed 9y ago1 watchersCompare

[ Source](https://github.com/augustianne/DeviceDetectorBundle)[ Packagist](https://packagist.org/packages/yan/device-detector-bundle)[ RSS](/packages/yan-device-detector-bundle/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (3)Dependencies (3)Versions (5)Used By (0)

DeviceDetectorBundle
====================

[](#devicedetectorbundle)

Symfony2 Bundle for switching controllers for different device views. This caters to adaptive websites with two different controller for mobile and desktop views.

**Sample Configuration**

**1. Simple desktop to mobile controller redirect.**

This will render th mobile view for tablets as well.

```
device_detector:
    mobile:
        enabled: true
        controllers:
            -
                from_controller_path: 'Acme\MainBundle\Controller\Frontend'
                to_controller_path: 'Acme\MainBundle\Controller\MobileFrontend'
                routes:
                    - 'acme_frontend_homepage'
                    - 'acme_frontend_news'
                    - 'acme_frontend_about_us'

```

**2. Simple desktop to mobile redirection but render desktop view for tablets.**

```
device_detector:
    tablet:
        treat_as_mobile: false
        controllers: []
    mobile:
        enabled: true
        controllers:
            -
                from_controller_path: 'Acme\MainBundle\Controller\Frontend'
                to_controller_path: 'Acme\MainBundle\Controller\MobileFrontend'
                routes:
                    - 'acme_frontend_homepage'
                    - 'acme_frontend_news'
                    - 'acme_frontend_about_us'

```

**3. Simple desktop to tablet controller redirect.**

By default, the bundle will treat tablets as mobile devices and will follow the configuration for mobile redirection, so it is important to set `treat_as_mobile` to false when tablet redirection is enabled.

```
device_detector:
    tablet:
        enabled: true
        treat_as_mobile: false
        controllers:
            -
                from_controller_path: 'Acme\MainBundle\Controller\Frontend'
                to_controller_path: 'Acme\MainBundle\Controller\TabletFrontend'
                routes:
                    - 'acme_frontend_homepage'
                    - 'acme_frontend_news'
                    - 'acme_frontend_about_us'
    mobile:
        enabled: true
        controllers:
            -
                from_controller_path: 'Acme\MainBundle\Controller\Frontend'
                to_controller_path: 'Acme\MainBundle\Controller\MobileFrontend'
                routes:
                    - 'acme_frontend_homepage'
                    - 'acme_frontend_news'
                    - 'acme_frontend_about_us'

```

**4. Setting optional mobile view.**

An option is provided for optional rendering of mobile pages via setting of a cookie. If this cookie is set, this will override the redirection and render the desktop version until cookie expires.

```
device_detector:
    override_cookie: 'DEVICE_DETECTOR_OVERRIDE'
    tablet:
        enabled: true
        treat_as_mobile: false
        controllers:
            -
                from_controller_path: 'Acme\MainBundle\Controller\Frontend'
                to_controller_path: 'Acme\MainBundle\Controller\TabletFrontend'
                routes:
                    - 'acme_frontend_homepage'
                    - 'acme_frontend_news'
                    - 'acme_frontend_about_us'
    mobile:
        enabled: true
        controllers:
            -
                from_controller_path: 'Acme\MainBundle\Controller\Frontend'
                to_controller_path: 'Acme\MainBundle\Controller\MobileFrontend'
                routes:
                    - 'acme_frontend_homepage'
                    - 'acme_frontend_news'
                    - 'acme_frontend_about_us'

```

###  Health Score

28

—

LowBetter than 54% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity11

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity61

Established project with proven stability

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~187 days

Total

3

Last Release

3750d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/55b0720b86323412fb53b79d74eff2e5e3999804c4b7d290bc0584dbe999d5fd?d=identicon)[augustianne](/maintainers/augustianne)

---

Top Contributors

[![augustianne](https://avatars.githubusercontent.com/u/1718271?v=4)](https://github.com/augustianne "augustianne (9 commits)")

---

Tags

mobiledevicedevice detectsymfony mobilesymfony device

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/yan-device-detector-bundle/health.svg)

```
[![Health](https://phpackages.com/badges/yan-device-detector-bundle/health.svg)](https://phpackages.com/packages/yan-device-detector-bundle)
```

###  Alternatives

[jenssegers/agent

Desktop/mobile user agent parser with support for Laravel, based on Mobiledetect

4.8k67.8M440](/packages/jenssegers-agent)[suncat/mobile-detect-bundle

Symfony2/3/4 bundle for detect mobile devices, managing mobile view types, redirect to mobile version.

4035.3M7](/packages/suncat-mobile-detect-bundle)[hisorange/browser-detect

Browser &amp; Mobile detection package for Laravel.

1.1k10.1M50](/packages/hisorange-browser-detect)[clausnz/php-helpers

A Collection of useful php helper functions.

388.7k](/packages/clausnz-php-helpers)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
