Laravel 4 Form::open set action

拈花ヽ惹草 提交于 2019-12-06 11:34:48

You can use named route, controller action or simple url to set form action.

To set it via named route use:

{{ Form::open(array('route' => array('route_name', $client->id))) }}

To set it via controller action use:

{{ Form::open(array('action' => array('ClientController@update', $client->id))) }}

So the keyword action does not reffer to 'action' parameter of form tag, but to controller action

And you can also use plain URL like this:

{{ Form::open(array('url' => 'someurl')) }}

@jeffrey_way tweeted about improving the new FormBuilder in Laravel 4. The following paste bucket link should help. It seems to be more about RESTful controllers, but relavant.

Form action sensible defaults - paste bucket

I thought I read something about him coming out with a Forms tutorial tomorrow. If so, it might be found here net.tutsplus.com/?s=laravel

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!