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 48<br />

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

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

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

4 "route" => "group/add",<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 ])}}<br />

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

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

15 @stop<br />

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

17 @parent<br />

18 <br />

19 @stop<br />

.<br />

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

You’ll notice how much neater the view is; thanks to the form class handling the error messages for<br />

us. This view happens to be relatively short since there’s only a single field (name) for groups.<br />

1 .help-block<br />

2 {<br />

3 float : left;<br />

4 clear : left;<br />

5 }<br />

6<br />

7 .form-group.has-error .help-block<br />

8 {<br />

9 color : #ef7c61;<br />

10 }

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

Saved successfully!

Ooh no, something went wrong!