How does laravel determine the mobile terminal and pc terminal?
春天2020-10-28 22:46:20
0
1
1666
The website has two sets of templates, mobile and PC. How to jump to the mobile and PC templates through a domain name, how to write the code in the controller, please give me some advice from teachers, friends, and masters. Thank you.
I don’t know about laravel, I have never used this framework. I believe there should be a place to set the template directory, right? You can add a judgment in the template directory or view directory. Use UA to determine whether it is a PC or a mobile phone. If it is a PC If accessed by mobile phone, the template path is set to A. If it is accessed by mobile phone, the template path is set to B.
I don’t know about laravel, I have never used this framework. I believe there should be a place to set the template directory, right? You can add a judgment in the template directory or view directory. Use UA to determine whether it is a PC or a mobile phone. If it is a PC If accessed by mobile phone, the template path is set to A. If it is accessed by mobile phone, the template path is set to B.