[FLOW3-general] Validation of Arrays in an Action

David Sporer david.sporer at gmail.com
Thu Dec 27 22:07:13 CET 2012


Hi,

old question but now I'm trying to really fix it and it doesn't seem to
work.
If I add the arrays (along with other parameters) to the newAction() the
array is always null.
Currently my newAction is
newAction(\My\Object newObject, array1=array(), array2=array(),
array3=array())

I'm not assigning newObject to the view manually and it's null if I add a
die() in the newAction but the values I've entered e.g. for the name of the
new action are displayed in the form. But I can't get the values of the
arrays.
I'm using a custom Validator for the arrays. Don't know if this could cause
problems?

What else can I try?

Regards
David


2012/9/23 "Christian Müller (Kitsunet)" <christian.mueller at typo3.org>

> On 22.09.2012 15:02, David Sporer wrote:
>
>> Hi,
>>
>>
>>
>> another question:
>>
>> I'm passing three arrays to an action and I'm validating these which works
>> fine.
>>
>> But I'm struggling at the point where the validation of one array fails.
>> Then I want to the new form to contain the already valid values of the
>> other
>> arrays.
>>
>> I saw that it doesn't work automatically.
>>
>>
>>
>> e.g.
>>
>>
>>
>> newAction(){
>>
>> }
>>
>
> Exactly here is the problem, your newAction needs to accept your three
> arrays with the same names as the createAction, so it should look like this:
>
> newAction($array1 = array(), $array2 = array(), $array3 = array()){
>
> Which allows calling of the newAction without any parameters but if the
> arrays are present they are at your disposal in the action. Of course you
> need to also assign them to the view then to be able to access the values.
>
> Cheers,
> Christian
>
>
> ______________________________**_________________
> FLOW3-general mailing list
> FLOW3-general at lists.typo3.org
> http://lists.typo3.org/cgi-**bin/mailman/listinfo/flow3-**general<http://lists.typo3.org/cgi-bin/mailman/listinfo/flow3-general>
>


More information about the FLOW3-general mailing list