刚开始学tp6
执行tp6.io/index/Index/hello()的时候执行结果是tp6.io/index/Index/index的,其他控制器也一样,比如
tp6.io/index/Index/user也是
代码:
<?phpnamespace app\controller;use app\BaseController;use think\facade\Db;use think\facade\Env;class Index extends BaseController{ public function index(){ return 'administrator'; } public function user(){ return 'users'; } public function hello($name = 'ThinkPHP6') { return 'hello,' . $name; }}
Copyright 2014-2024 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号