<?php
namespace app\index\controller;
use think\Controller;
use think\Route;
class Index extends Controller
{
public function index()
{
Route::get("data",function(){
return view("hello");
});
}
}第一次使用tp5写接口,自己的理解是直接在index方法里使用Route::get就可以简单实现接口效果,但是不理解Route::get(“A”,“B”)里面两个参数的意思,如果我要调用后面的函数值,我应该怎么书写url,有知道的朋友能简单举个例子吗? 最佳答案