2017 © Pedro Peláez
 

library device-detector-bundle

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

image

yan/device-detector-bundle

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

  • Monday, December 12, 2016
  • by augustianne
  • Repository
  • 1 Watchers
  • 1 Stars
  • 81 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 5 Versions
  • 1 % Grown

The README.md

DeviceDetectorBundle

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

Sample Configuration, (*2)

1. Simple desktop to mobile controller redirect., (*3)

This will render th mobile view for tablets as well., (*4)

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., (*5)

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., (*6)

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., (*7)

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., (*8)

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., (*9)

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'

The Versions

12/12 2016

dev-master

9999999-dev

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

  Sources   Download

MIT

The Requires

 

The Development Requires

mobile device device detect symfony mobile symfony device

11/02 2016

v1.0.2

1.0.2.0

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

  Sources   Download

MIT

The Requires

 

The Development Requires

mobile device device detect symfony mobile symfony device

11/02 2016

dev-issue_2

dev-issue_2

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

  Sources   Download

MIT

The Requires

 

The Development Requires

mobile device device detect symfony mobile symfony device

02/02 2015

v1.0.1

1.0.1.0

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

  Sources   Download

MIT

The Requires

 

The Development Requires

mobile device device detect symfony mobile symfony device

01/02 2015

v1.0.0

1.0.0.0

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

  Sources   Download

MIT

The Requires

 

The Development Requires

mobile device device detect symfony mobile symfony device