首先,先做一個簡單的表單頁面
<html> <head> </head> <body> <form action="/submit" method="post"> <input type="text" name="a"></input> <input type="text" name="b"></input> <input type="text" name="c"></input> <input type="submit"></input> </form> </body><html>
編輯一條路由
Route::post('/submit','FormController@store');創建一個控制器
<?phpnamespace App/Http/Controllers;//use Illuminate/Http/Request;use App/Http/Requests;use Request;class FormController extends Controller{  public function store(){		//var_dump(Request::all());		$input=Request::all();		echo $input['a'].PHP_EOL;		echo $input['b'].PHP_EOL;		echo $input['c'].PHP_EOL;	}}新聞熱點
疑難解答
圖片精選