[TYPO3-mvc] Fluid: Complex forms best practice

Nikolas Hagelstein lists at shr-now.de
Wed Jul 8 12:59:56 CEST 2009


Hi,

 

Using fluid to generate a simple edit form for a single domain object is
fairly straight forward. 

But as soon as  extra information or additional objects come into play
things are getting confusing quickly.

Thus I would like to discussion/hear/ several viable solution for such
scenarios.

 

Forms on websites often consists of fields that are not necessarily
belonging to a single "domain object".  

 

Scenario registration form:

Let's assume a registration form should consists of several fields that are
directly mapped to  domain object properties (e.g. User.name etc.),

while others are mapped to another object  or even do not belong to a model
at all.

 

No problem for the for the  "another object" part as long as this object is
somehow related to the "main object (user)" - The repository will take care
of it.

But what about additional fields that do not belong to the main object
itself?.

Common samples for such fields would be statistical information that should
be saved anonymously or fields that need to be combined to a model property
or

information that should not be saved locally e.g.  passed to a 3rd party
site or white label provider using a webservice?

 

The most obvious solution for such a scenario is to forgo  all fluid magic
(field population, validation etc). 

This means put everything to a huge data container (tx_foo[data][xyz])  pass
it over  to the controller and  process it manually.

 

One that came to my mind was to create a non-persistent meta "registration
object"

but I am not sure yet it this is a passable solution. Any comments on this?

 

I wonder if there are more comfortable solutions.

 

Cheers,

Nikolas

 

 



More information about the TYPO3-project-typo3v4mvc mailing list