Home >PHP Framework >ThinkPHP >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', // 默认操作名称
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', // 默认操作名称
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!