thinkPHP3.2 page URL What do I do without a module name?

Source: Internet
Author: User
thinkPHP3.2 page URL What do I do without a module name?

Http://localhost/think_message/index.php/Index/index/p/2.html This is the default
Http://localhost/think_message/index.php/Home/Index/index/p/2.html This is the right thing, the Home module is missing.


Reply to discussion (solution)

Generate URLs using the U method

Can you do something specific, please?

There is no module name, because the current module is the default module, so your URL is not a problem:

    ' default_module '     = ' Home ',//default module    ' module_deny_list '   = = Array (' Common ', ' User '),//block access Module    ' Module_allow_list '  = = Array (' Home ', ' Admin '),//Allow access to the module

Your question is not when the template generated the URL, there is no module name? If so, you can use the constant module_name to get:
{: U (module_name. ' Controller name/Method name ')}

Under the stupid, can you elaborate on where to set the module_name? I use TP to bring the page, manual paging This column does not set the URL

It should be that you are using the TP3.1 page class (tp3.1 unless it is a group, otherwise there is no home level, and tp3.2 always has a home level)
You should go to the TP website to see if there is a new page class

If you really want to digest yourself, then you should modify the page so that he adapts to the tp3.2 change.

I use the version is thinkPHP3.2.3, the level is really very dishes, the manual does not see the URL settings

$show = Str_replace ("index.php/index/", "index.php/home/index/", $show, $index);

It's settled, thank you.

  • 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.