2、框架安装
# 创建项目composer create-project easyswoole/app easyswoole# 进入项目目录并启动cd easyswoole php easyswoole start
推荐(免费):swoole
App\HttpController
是控制器目录,我们新建一个User.php
,代码如下:
response()->withHeader('Content-type','application/json;charset=utf-8'); $this->response()->write(json_encode($data)); } public function test() { $this->response()->write("test method for the User Controller"); } }
重新启动项目,浏览器访问
以上就是Swoole框架之easyswoole安装的详细内容,更多请关注其它相关文章!