Home > PHP Framework > ThinkPHP > How to set default access path in thinkphp

How to set default access path in thinkphp

Release: 2020-04-17 09:11:10
forward
5426 people have browsed it

How to set default access path in thinkphp

When using thinkphp, you usually directly access the Index method under the IndexController control. So how is it set?

ThinkPHP root directory settings

Find ThinkPHP/conf/convention.php under the root directory

    'DEFAULT_MODULE'        =>  'Home',  // 默认模块
    'DEFAULT_CONTROLLER'    =>  'Index', // 默认控制器名称
    'DEFAULT_ACTION'        =>  'index', // 默认操作名称
Copy after login

The meaning of these three is under the Index controller under the Home module index method.

Configuration file settings

Add a section in Common/conf/config.php

For example, I want to access the login method under the App control under Application

    'DEFAULT_MODULE'        =>  'Aplication',  // 默认模块
    'DEFAULT_CONTROLLER'    =>  'App', // 默认控制器名称
    'DEFAULT_ACTION'        =>  'login', // 默认操作名称
Copy after login

Same as above, it will take effect.

Recommended tutorial: thinkphp tutorial

The above is the detailed content of How to set default access path in thinkphp. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Latest Issues
Why thinkphp has better performance than laravel?
From 1970-01-01 08:00:00
0
0
0
ThinkPHP Why use composer?
From 1970-01-01 08:00:00
0
0
0
thinkphp versions supported by php6
From 1970-01-01 08:00:00
0
0
0
thinkphp upload files
From 1970-01-01 08:00:00
0
0
0
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template