ThinkPHP资源控制器

版本:5.1.8

官方说明:https://www.kancloud.cn/manual/thinkphp5_1/353984

进入的是对应的项目,而不是thinkphp核心目录,然后执行命令行

php think make:controller app\index\controller\Blog

生成的目录结构如下,当然,自动生成的方法体都是空的,index里面的方法体return "hello world";是自己添加上去的

然后在route/route.php里面添加

Route::resource('blog','index/blog');

这时候访问结果如下


猜你喜欢

转载自blog.csdn.net/weixin_37909391/article/details/79905671