[TYPO3-50-general] MVC argument handling

Christoph Blömer chbloemer at gmx.net
Mon Jul 27 21:28:10 CEST 2009


Christoph Blömer schrieb:
> Hi,
> I try to get the argument handling to work in the RESTController.
>
> This is my class:
>
> class ClientController extends \F3\FLOW3\MVC\Controller\RESTController{
>
>     /**
>      * Create a new customer
>      *
>      * @param string $customerName Name of the customer
>      */
>     public function createAction($customerName) {
>         echo "customerName:".$customerName;
>     }
> }
>
> I send an POST request with the parameter customerName and some value.
> It is executed correct but $customerName is always empty.
>
> Do I need to register the argument somewhere else?
> Any hint? Or is this a bug?
>   
This is a Bug.
In the RESTController the following method is called in the 
proccessRequest method.
$this->arguments->addNewArgument('id', 'UUID', FALSE);

This shifts all arguments.
Now the paramenter of the 1st argument is in the 2nd argument.

If this would be done in an initializeAction Method the id Argument 
would be added to the end of the array and it would work.
But actually it also shouldn't be passed to the method if it is not 
required or specified by the method.

Greetings
Christoph


More information about the TYPO3-project-5_0-general mailing list