Is there any way that I can detect browser type on routing and use specific controller? I want to be able to do something like this in routing.yml:
mobile:
url: /*
requirements:
browser: mobile
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
This symfony blog article from Fabien describes an elegant solution for an iPhone-optimised version of your website. Change the regexp he uses to something that more broadly matches the browsers/clients used to access your site, and you have a ‘mobile’ version.
EDIT: I would add that perhaps a different ‘app’ altogether might be a better solution, a la Facebook’s m.facebook.com interface.