Laravel is having great feature for the nice urls. We can use the controllers and functions for custom urls
ex:
Route::get('sample/getdata/{id}', array('uses' => 'controllername@functionname'));
In the above routing concept if we give
www.sample.com/sample/getdata/25
it will point to the controller function like
class controllername extends BaseController { public function functionname($id = null) { } }
from the above controller function we can get the id value as parameter
Here we are going to look into the function to get the submitted values inside the controller function
Route::match(array('GET', 'POST'), 'submit/submiturl', array('uses' => 'SubmitController@submitfunction'));
in the above code if we submitting the values to a url like
http;//www.sample.com/submit/submiturl
and we can get the values in the function submitfunction inside the SubmitController
i.e.,
class SubmitController extends BaseController { public function submitfunction() { $submitedData = Input::get(); } } }
the Input::get(); function is for getting the submitted post value
Here we have to think about another thing.If we are submitting a value to the url which may or may not have the parameter.
For that we have to use the following code
Route::match(array('GET', 'POST'), 'submitted/submitfunction/{id?}', array('uses' => 'SubmitController@submitFunction'));