mercredi 18 janvier 2017

Merge create and edit blade files to 1 file?

I have created a create form create.blade.php and a edit form edit.blade.php - both form fields are identical.

It quite annoying when I add new fields in the create.blade.php, I also need to add fields in edit.blade.php.

How can I merge into 1 blade file it so it work for both way for creating and editing (view via db).

For example in create.blade.php I have this:

<label>Name</label>
<input type="text" name="name" value="">
@if ($errors->has('name'))
  <label class="error"></label>
@endif

In edit.blade.php

<label>Name</label>
<input type="text" name="name" value="">
@if ($errors->has('name'))
  <label class="error"></label>
@endif



from Newest questions tagged laravel-5 - Stack Overflow http://ift.tt/2jYYVHh
via IFTTT

Aucun commentaire:

Enregistrer un commentaire