namespace app\home\controller\v2;
use think\facade\Session;
use app\ba
use think\facade\View;
use think\facade\Request;
use think\exception\ValidateException;
class Index
{
public function index()
{
$info=\request()->getInput('name');
var_dump($info);
return \view('display');
//return redirect('/diplay')->with($info);
}
}
———————————————————————————————
<!DOCTYPE html>
<html lang="en">
<head>
<me
<ti
</head>
<form action=<form action={:url('Index/index')} method="post">
<p>First name: <input type="text" name="name" /></p>
<input type="submit" value="Submit" />
</form>
$info
</body>
</html>
——————————————————————————————
Route::rule('v2', 'v2/Index/index');
Route::view('v2', 'v2/index/index');
最佳答案