Answer the question
In order to leave comments, you need to log in
How to set form field name manually?
There is a form class:
class LoginForm extends AbstractType<br>
{<br>
public function buildForm(FormBuilder $builder, array $options)<br>
{<br>
$builder->add('username','text');<br>
$builder->add('password','password');<br>
}<br><br>
public function getName()<br>
{<br>
return 'login';<br>
}<br>
}<br>
<form action="/app_dev.php/login_check" method="post"><br>
<div id="login"><br>
<input type="hidden" id="login__token" name="login[_token]" value="b7521243e04f79fb55c77c6ea8dc782578beab99" /><br>
<div><br>
<label for="login_username" class=" required">Username</label><br>
<input type="text" id="login_username" name="login[username]" required="required" /><br>
</div><br>
<div><br>
<label for="login_password" class=" required">Password</label><br>
<input type="password" id="login_password" name="login[password]" required="required" /><br>
</div><br>
</div><br>
<input type="submit" name="login" /><br>
</form>
form_login:<br>
check_path: /login_check<br>
login_path: /login<br>
username_parameter: login[username]<br>
password_parameter: login[password]
Answer the question
In order to leave comments, you need to log in
The authorization form is written manually, because. there is no sense from the class - form_login makes a redirect.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question