I'm working on this method:
public function loginAction(Request $request, Security $security)
{
$session = $request->getSession();
$session->remove('admin_project_id');
if ($security->has(Security::AUTHENTICATION_ERROR)) {
$error = $request->attributes->get(Security::AUTHENTICATION_ERROR);
} else {
$error = $session->get(Security::AUTHENTICATION_ERROR);
$session->remove(Security::AUTHENTICATION_ERROR);
}
return $this->render('PDOneBundle:Login:index.html.twig',
array_merge($this->defaultViewParams(), array(
'last_username' => $session->get(Security::LAST_USERNAME),
'error' => $error,
'include_sidebar' => false,
)
)
);
}
But I got this error when it's called:
Controller "GroupDCA\PDOneBundle\Controller\LoginController::loginAction()" requires that you provide a value for the "$security" argument (because there is no default value or because there is a non optional argument after this one).
What should be the default value for that argument? Is the way I'm using right?