Project

General

Profile

Actions

Feature #70634

closed

Proper view helper for generating nested / child records

Added by Pascal Dürsteler over 8 years ago. Updated over 8 years ago.

Status:
Rejected
Priority:
Won't have this time
Assignee:
-
Category:
Fluid
Target version:
-
Start date:
2015-10-12
Due date:
% Done:

0%

Estimated time:
PHP Version:
Tags:
Complexity:
Sprint Focus:

Description

If I'm wrong, I'll let you enlighten me happily.

Current situation
You want to provide a form where a user creates not just one model / record, but also n nested records, or child records (e.g.: when creating a Pizza object, you also create five Topping records associated with it).

In your form, you scramble something together with f:form.textfield for each Topping and either use the "property" or "name" attribute. However, this gives your form much more complexity, as you have to maintain the index for the params array (pizza[toppings][n][name]) yourself.

You also have to manually throw together some code into your initializeAction for extbase to not raise an error because your data is missing inside __trustedProperties.

Request for change
I'd say the following code snipped is a self-explanatory example about how it could work:

<f:form action="create" object="{pizza}" objectName="pizza">
    // fields for pizza itself go here

    <f:form.fields property="pizza.toppings" collection="{pizza.toppings}">
        // fields for each pizza.toppings record go here.
        // context for sub-properties is recognized.

        // field for each topping's "name" property
        <f:form.textfield property="name" />
    </f:form.fields>
</f:form>

Related issues 1 (1 open0 closed)

Related to TYPO3 Core - Bug #73717: validation results for child properties per propertyNew2016-02-27

Actions
Actions

Also available in: Atom PDF