[FLOW3-general] Mapping and adding objects - problem with properties
Ferdinand Kuhl
fcool at coolys.de
Wed Aug 31 19:06:22 CEST 2011
No Problem! I'm sure we all had similar experiences before. ;)
What kind of relation?
Basically you will have to do the following:
FLUID-Form:
<f:form.textfield property="address.city" />
<f:form.textfield property="address.zip" />
...
And in your Controller:
public function initializeCreateAction() {
$this->arguments['newUser']->getPropertyMappingConfiguration()-
>allowCreationForSubProperty('address');
}
The rest should Flow3 do for you ;)
Have a nice evening,
Ferdinand
Dawid Pacholczyk wrote:
> OH MY GOD !!!!!!!!!!!!!!!!!!!!
>
> Sorry but I lost 2 days for that :/ I`ve changed the field, I`ve changed
> the getter but I had to forget about setter. Thank you Sebastian
>
> Ferdinand big thank you to you too for your time
>
> Guys, what about second question ? I have association with Address
> object and I would like to put in my New.html 3 fields from address
>
> street, city, zip
>
> They are not User properties but Address properties. How can I in
> initial method receive values and combine them to Address object and
> invoke setAddress ?
>
> Best regards,
> Dawid Pacholczyk
>
> W dniu 2011-08-31 18:38, Sebastian Kurfürst pisze:
>> Hey,
>>
>>> public function setAge($birthdate) {
>>> $this->birthdate = $birthdate;
>>> }
>>
>> That's the error :-) It must be "public function setBirthdate".
>>
>> Greets,
>> Sebastian
>>
More information about the FLOW3-general
mailing list