I've just started on using Symfony (version 2.2.1) and have ran into a little problem.
I have a plain HTML form (non-Symfony) in IntraController->indexAction and I want it to post to AuthController->loginAction. When I want to check in loginAction to see if the POST is getting passed to it, it just shows me an empty object.
My HTML form is as follows:
<form class="form-signin" action="auth/login" method="post">
<h2 class="form-signin-heading">Admin Access</h2>
<div class="input-prepend">
<span class="add-on" style="padding: 7px 9px;"><i class="icon-user"></i></span>
<input type="text" name="a_username" class="input-block-level" placeholder="Username...">
</div>
<div class="input-prepend">
<span class="add-on" style="padding: 7px 9px;"><i class="icon-lock"></i></span>
<input type="password" name="a_password" class="input-block-level" placeholder="Password...">
</div>
<button class="btn btn-success" name="post_auth" type="submit">Authenticate</button>
<a class="btn" href="../">Return to Homepage</a>
</form>
And this is how I'm trying to get the POST request in loginAction:
public function loginAction(){
return new Response(serialize($this->getRequest()->request->all()));
}
I've also tried getting a single POST item using:
return new Response(serialize($this->getRequest()->request->get('a_username')));
Sadly I'm getting an empty POST so I'm guessing that it gets emptied when it goes to auth/login. How could I preserve the POST data so it doesn't get emptied?