03.12.2015 Views

laravel4cookbook

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Access Control List 50<br />

Editing Groups<br />

The view and action for editing groups is much the same as for adding groups.<br />

1 @extends("layout")<br />

2 @section("content")<br />

3 {{ Form::open([<br />

4 "url" => URL::full(),<br />

5 "autocomplete" => "off"<br />

6 ]) }}<br />

7 {{ Form::field([<br />

8 "name" => "name",<br />

9 "label" => "Name",<br />

10 "form" => $form,<br />

11 "placeholder" => "new group",<br />

12 "value" => $group->name<br />

13 ]) }}<br />

14 {{ Form::submit("save") }}<br />

15 {{ Form::close() }}<br />

16 @stop<br />

17 @section("footer")<br />

18 @parent<br />

19 <br />

20 @stop<br />

.<br />

This file should be saved as app/views/group/edit.blade.php.<br />

The only difference here is the form action we’re setting. We need to take into account that a group<br />

id will be provided to the edit page, so the URL must be adjusted to maintain this id even after the<br />

form is posted. For that; we use the URL::full() method which returns the full, current URL.

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!