[FLOW3-general] arrays in a HTML <form> and Property Mapping
mario chiari
m at mariochiari.net
Thu Oct 25 21:15:49 CEST 2012
Hello
I need help on the following very simple homework I gave to myself :-)
Consider a usual, simple way to pass an array by a HTML form
http://www.php.net/manual/en/faq.html.php#faq.html.arrays and say I
echo back the array of values.
How do I do the same by FLOW?
I kickstart a one model, one property package:
Package Test.Basic
Model:
class Person {
/**
* The name
* @var string
*/
protected $name;
....
}
----
Now I define a (dummy) newAction() and a New.html fluid template:
PersonController:
public function newAction() {}
Template New.html:
....
<f:form action="echo" name="newPerson">
<f:form.textfield property="name." id="name" /> <<< note the dot (cool!)
<f:form.textfield property="name." id="name" /> <<< two (or more) input fields
<f:form.submit value="Echo" />
....
------
and Fluid renders:
<input id="name" name="newPerson[name][]" type="text">.
So far so good.
Now - speaking very loosely - how do I map the array newPerson to >two<
Person objects and define a echoAction()?
I am not able to use any of the hints I read at
http://flow.typo3.org/documentation/guide/partiii/propertymapping.html
I do not see how to use any TypeConverter (ArrayConverter,
CollectionConverter, ...)
(I am still using FLOW3 1.1.0-rc1)
thanks for your help
cheers
mario
More information about the FLOW3-general
mailing list