Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make mobile_detect.mobile_detector use the device_view cookie feature #99

Open
adrienbrault opened this issue Sep 2, 2016 · 2 comments

Comments

@adrienbrault
Copy link

Hey,

I was puzzled when first messing around with the toolbar feature to change the current view type, because it would not change the result of $container->get('mobile_detect.mobile_detector')->isMobile()

@erikbaan
Copy link

you should use the mobile_detect.device_view helper with method isMobileView

@leroy0211
Copy link

The mobile_detect.device_view service is a private service, which causes a deprecation notice because getting private services wil fail in symfony 4. I prefer adding the isMobileView() etc. methods to the mobile_detect.mobile_detector service. It's way more in line with the available Twig Functions.

In Twig it's very easy to do so, just calling is_mobile_view() function, but in PHP you have to get another service to do so, which in turn is private.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants