Love Fuel?    Donate

FuelPHP Forums

Ask your question about FuelPHP in the appropriate forum, or help others by answering their questions.
Fuelphp support for nested models in Fieldset class?
  • Hello, I need to build a form where one ORDER has many MEMBERS. This means the parent form has a set of fields, but there is also a dynamic part of the form where the nested model, MEMBERS, ORDER Order number
    Email
    Order date
    The nested model's fields follow
    Member details 1
    -- Name
    -- Date of birth
    -- Nationality Member details 2
    -- Name
    -- Date of birth
    -- Nationality Member details 3...
    and so on... So my question is, can I use the Fieldset class to generate more than one instance of the same form fields at a time, and validate them on submit, and repopulate all form fields on submit/edit? I hope this question makes sense (I have a feeling this isn't very clear). Basically, I did this in Rails by following this tutorial: http://railscasts.com/episodes/197-nested-model-form-part-2 But I'd like to do this in Fuelphp. Any help appreciated. Thanks, Matt
  • Could you give an example? How would it work with ORM save to DB? WIth validation? Thanks in advance.
  • I don't think this is the right way to approach this. If you're using ORM, it is better to use the built-in validation feature of the ORM model, and just validate every model instance individually.
  • You can nest fieldsets by adding one as a field to another.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

In this Discussion