adamwathan / form

Super basic form HTML builder, only really exists so I can pull it in for some other more useful projects.
MIT License
232 stars 118 forks source link

Form::bind() and relationships #69

Closed Erwane closed 7 years ago

Erwane commented 8 years ago

Consider having one model Devis and one DevisData. One Devis hasMany DevisData, linked by DevisData.devis_id field.

how can i do that in controller and view ? : Controller : $devis = Devis::find($id); $datas = $devis->datas; // hasMany defined in model

View : Form::bind($devis + $datas)

Inputs are automatically filled.

My input field names looks like that :

I think we should define the "row" in Form::bind() method.

adamwathan commented 8 years ago

Currently not supported automatically, would have to bind the values yourself. Happy to look at PRs, likely won't get around to implementing it myself though.