03.12.2015 Views

laravel4cookbook

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

File-Based CMS 345<br />

72 class="form-control"<br />

73 id="code"<br />

74 name="code"<br />

75 rows="5"<br />

76 placeholder="&lt;div&gt;Hello world&lt;/div&gt;"<br />

77 >{{ Input::old("code", $code) }}<br />

78 <br />

79 <br />

80 <br />

81 @stop<br />

.<br />

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

The views follow a similar pattern to those which we created for managing layout files. The<br />

exception is that we add the new layout and route fields to the add and edit page templates. We’ve<br />

used the Form::select() method to render and select the appropriate layout.<br />

1 Route::any("admin/page/index", [<br />

2 "as" => "admin/page/index",<br />

3 "uses" => "PageController@indexAction"<br />

4 ]);<br />

5<br />

6 Route::any("admin/page/add", [<br />

7 "as" => "admin/page/add",<br />

8 "uses" => "PageController@addAction"<br />

9 ]);<br />

10<br />

11 Route::any("admin/page/edit", [<br />

12 "as" => "admin/page/edit",<br />

13 "uses" => "PageController@editAction"<br />

14 ]);<br />

15<br />

16 Route::any("admin/page/delete", [<br />

17 "as" => "admin/page/delete",<br />

18 "uses" => "PageController@deleteAction"<br />

19 ]);

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

Saved successfully!

Ooh no, something went wrong!