PHP TP5入门 二:写接口,添加控制器并访问

默认访问地址:http://localhost/TP5/tp5/public/index.php/index/hello_world

实现代码:

<?php
namespace app\index\controller;

class HelloWorld 
{
    public function index()
    {
        return '22hello,world!';
    }
}

添加一个控制器如下结构

访问效果图:

发布了411 篇原创文章 · 获赞 809 · 访问量 199万+

猜你喜欢

转载自blog.csdn.net/qq_35713752/article/details/104898894