Symfony renders form field names using this taplate:formName[fieldname]
It means that when you post your form, you get the form values in an array under the formName
So in order to get you form values you must do something like this:
- Code: Select all
$form = new YourForm();
$form_name = $form->getName();
$parameters = $request->getParameter($form_name);
variable will hold an array of your form field values.
If you want your username to be unique, thirst thing you must do is to add unique constraint to your databse username field. It will ensure, that there will be no duplicates in your database. And when you get a username from posted form, you must query your database for that user, and if you find one in the database output an error messeage to your registration page.
If you will have trouble of doing that, post your question here.
Symfony Configuration Reference - everything you can't find elsewhere:http://www.symfonyreference.com