Just like the title
The following project directory structure. How to configure the mobile website. I found the is_mobeli() function on the Internet to make a judgment. How to configure it specifically? Please give me some advice
Just like the title
The following project directory structure. How to configure the mobile website. I found the is_mobeli() function on the Internet to make a judgment. How to configure it specifically? Please give me some advice
You mean to start a new module, and then that module displays the wap page. The page entry should be judged based on is_mobile. Now you have BIND_MOUDLE an App
Judged in the entry file. It is best to rewrite the controller of the mobile phone separately. Of course, if the gap between the mobile phone and PC is not too big, you can use the same set.
This is what we do when we do it. PC-side pages are inherited from Base/PcBase.html, and PcBase.html contains content such as header footer. Then put a js script in PcBase.html to detect whether it is a mobile device. If it is a mobile device, it will automatically jump to the mobile terminal.
It depends on the size of your project. If the project is not large, you can directly create a MobileContoller under Home. If it is large, pull a MobileMoudle to do it.
We did not use is_mobile, but used js script to judge. Use the one you like.
Is it an old thinkphp3.0 project?
Then first update config.php, add a Mobile group, and set the command yourself, as follows
<code>'APP_GROUP_LIST' => 'Admin,Home,Member,Mobile' </code>
Then add the Mobile directory to Action, add the Mobile directory to Tpl, and continue developing various controllers, models, and views
Finally, if your Home group all inherits a base class such as
<code>class IndexAction extends BaseAction {</code>
Then you add the is_mobile function judgment to the _initialize function in BaseAction, so that all controller requests will trigger the judgment