thinkph5用常量定义模型、控制器、方法

2302

如果你比较习惯使用thinkphp3中常量用法,可以在入口文件定义常量

define('CONTROLLER_NAME',Request::instance()->controller());

define('MODULE_NAME',Request::instance()->module());

define('ACTION_NAME',Request::instance()->action());

=====

define('CONTROLLER_NAME',request()->controller());

define('MODULE_NAME',request()->module());

define('ACTION_NAME',request()->action());