Home > Article > Backend Development > Detailed explanation of Laravel's form submission function
This article shares with you a simple example of how to implement form submission in the process of using laravel. It is very simple. It is recommended here for friends who are learning laravel
First, make a simple form page
<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>
Edit a route
Route::post('/submit','FormController@store');
Create a controller
<?php namespace 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; } }
The above is the detailed content of Detailed explanation of Laravel's form submission function. For more information, please follow other related articles on the PHP Chinese website!