search

Home  >  Q&A  >  body text

How does laravel determine the mobile terminal and pc terminal?

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.

春天春天1488 days ago1667

reply all(1)I'll reply

  • 雕花笼

    雕花笼2020-10-30 08:30:18

    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.

    reply
    0
  • Cancelreply