[TYPO3-mvc] getting the arguments of the form?

Claus Due claus at wildside.dk
Mon Feb 20 14:06:51 CET 2012


Hi Stig,

Both of these should return the raw value. But due to PHP syntax you cannot do the reading in a single line - you always need to fetch the argument array, then fetch the desired index in that array. There is no alternative to this using the Request.

Cheers,
Claus

On Feb 20, 2012, at 1:59 PM, Stig Nørgaard Færch wrote:

> So you are saying, that with getArgument I cannot access the field directly, right?
> 
> But are there other one-code-line options? I guess that's my question...
> 
> /Stig
> 
> Den 20-02-2012 13:46, Claus Due skrev:
>> Hi Stig,
>> 
>> If reading directly from the action that accepts the argument:
>> $arguments = $this->request->getArgument('person');
>> 
>> If reading from a forwarded-to action, for example returned to newAction:
>> $arguments = $this->request->getOriginalRequest->getArgument($argumentName);
>> 
>> …returns the raw, un-mapped value of the original request's argument $argumentName, which is an array, containing index "streetName" if this was posted.
>> 
>> That is, if I remember things correctly.
>> 
>> Cheers,
>> Claus
>> 
>> On Feb 20, 2012, at 1:33 PM, Stig Nørgaard Færch wrote:
>> 
>>> I could have input form with the name:
>>> tx_myext_user_myextadmin[person][streetName]
>>> 
>>> then I could get the person array with:
>>> $this->request->getArgument('person');
>>> 
>>> But is possible to check directly on above input field?
>>> It doesn't seem like getArgument does the job here - but are there other methods to use?
>>> 
>>> /Stig
>>> _______________________________________________
>>> TYPO3-project-typo3v4mvc mailing list
>>> TYPO3-project-typo3v4mvc at lists.typo3.org
>>> http://lists.typo3.org/cgi-bin/mailman/listinfo/typo3-project-typo3v4mvc
>> 
> 
> _______________________________________________
> TYPO3-project-typo3v4mvc mailing list
> TYPO3-project-typo3v4mvc at lists.typo3.org
> http://lists.typo3.org/cgi-bin/mailman/listinfo/typo3-project-typo3v4mvc



More information about the TYPO3-project-typo3v4mvc mailing list