Closed
Description
Hello,
$request->get('name');
returns null for a POST parameter. In version 2.6.2 it was working fine. I couldn't find anything about the change in the release log. So with a fresh installation of the latest version, 2.6.4, the code now must be $request->get('form')['name']
.
However, for a web service, I'm not using a form, so I cannot access $request->get('form');
. How can I access the POST parameters now?
This is my code:
public function postUsersAction(Request $request)
{
$userManager = $this->container->get('fos_user.user_manager');
$user = $userManager->createUser();
$user->setUsername($request->get('username'));
$user->setEmail($request->get('email'));
$user->setPlainPassword($request->get('password'));
$user->setEnabled(true);
$validator = $this->get('validator');
$errors = $validator->validate($user, array('Registration'));
if (count($errors) == 0) {
$userManager->updateUser($user);
return $user;
} else {
return $errors;
}
}
Thank you
Metadata
Metadata
Assignees
Labels
No labels