WAP Web page-thinkphp3.0 project already has the PC side how to add mobile website?

Source: Internet
Author: User

Title

The following project directory structure How to configure the mobile Web site to find a Is_mobeli () function to make a judgment on how to configure the big God Guidance

Reply content:

Title

The following project directory structure How to configure the mobile Web site to find a Is_mobeli () function to make a judgment on how to configure the big God Guidance

You mean another module, then the module is the Display WAP page, page entrance according to Is_mobile to judge, you now bind_moudle an app

Judge in the place of the entrance document. It is better to separate the mobile phone controller and so on, of course, if the mobile phone and PC-side gap is not very large with the same set also line.

When we do this, the PC-side pages are inherited from the base/pcbase.html, pcbase.html the header footer and the like. Then the pcbase.html put JS script to detect whether it is a mobile device, if the mobile device automatically jump to the mobile side.
See you do project size, if the project is not small, you can do a mobilecontoller directly under the home, if the big words, pull a mobilemoudle to do.
We don't use is_mobile, but we use JS script to judge. You like that, you use that.

is thinkphp3.0 the old project?

Then first config.php in the update next to append a mobile group, command you to decide, as follows

'APP_GROUP_LIST' => 'Admin,Home,Member,Mobile'

Then add the mobile directory to the action, add the Mobile directory to the TPL, and continue with the various Controller,model,view development

Finally, if your home group inherits a base class, like

class IndexAction extends BaseAction {

So you add the Is_mobile function to the _initialize function in baseaction so that all controller requests trigger the judgment

  • Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.