Home  >  Article  >  Backend Development  >  Regarding the different methods of binding modules at the entry file and controllers under the modules in different versions of the thinkPHP framework

Regarding the different methods of binding modules at the entry file and controllers under the modules in different versions of the thinkPHP framework

巴扎黑
巴扎黑Original
2016-11-08 10:31:56941browse

For thinkPHP3.2.0 version:
Load module
$_GET['m'] = 'module name';
For example: $_GET['m'] = 'Admin'; to load the Admin module (backend module)
Load module Controller under
$_GET['c'] = 'controller name';
For example: $_GET['c'] = 'Admin'; to load the AdminController controller under the Admin module




for thinkPHP3 .2.1 and above versions:
Load module
define('BIND_MODULE','module name');
For example: define('BIND_MODULE','Admin'); to load the Admin module
Load the controller under the module
define( 'BIND_CONTROLLER','Controller name');
For example: define('BIND_CONTROLLER','Admin'); To load the AdminController under the Admin module



The above are defined at the entry file of the corresponding module. For example: Admin The module is defined under the admin.php file
The Home module is defined under the index.php file

Statement:
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