예제 #1
0
 /**
  * Implementation of the arguments initialization in the action controller:
  * Automatically registers arguments of the current action
  *
  * Don't override this method - use initializeAction() instead.
  *
  * @return void
  * @throws \TYPO3\Flow\Mvc\Exception\InvalidArgumentTypeException
  * @see initializeArguments()
  */
 public function initializeActionMethodArguments()
 {
     \TYPO3\Flow\Mvc\Controller\RestController::initializeActionMethodArguments();
 }
예제 #2
0
 /**
  * The content of the root request is used as resource argument.
  *
  * @return void
  * @throws \TYPO3\Flow\Mvc\Exception\InvalidArgumentTypeException
  * @see initializeArguments()
  */
 protected function initializeActionMethodArguments()
 {
     if ($this->request->__previousControllerActionName === 'index') {
         switch ($this->request->getHttpRequest()->getMethod()) {
             case 'POST':
             case 'PUT':
                 $arguments = $this->request->getArguments();
                 if (!isset($arguments[$this->resourceArgumentName])) {
                     $arguments[$this->resourceArgumentName] = [];
                 }
                 $arguments[$this->resourceArgumentName] = array_merge_recursive($arguments[$this->resourceArgumentName], $this->extractRequestBody());
                 $this->request->setArguments($arguments);
                 break;
         }
     }
     parent::initializeActionMethodArguments();
 }