Make mobile_detect.mobile_detector use the device_view cookie feature
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()
you should use the mobile_detect.device_view helper with method isMobileView
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.