mirror of
https://github.com/kevinveenbirkenbach/infinito.git
synced 2025-09-13 21:57:16 +02:00
Optimized register form
This commit is contained in:
@@ -5,6 +5,10 @@ use Symfony\Component\HttpFoundation\Response;
|
||||
use Symfony\Component\Routing\Annotation\Route;
|
||||
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
|
||||
use Symfony\Component\Security\Http\Authentication\AuthenticationUtils;
|
||||
use App\Entity\User;
|
||||
use Symfony\Component\Form\Extension\Core\Type\PasswordType;
|
||||
use Symfony\Component\Form\Extension\Core\Type\SubmitType;
|
||||
use Symfony\Component\Form\Extension\Core\Type\TextType;
|
||||
|
||||
/**
|
||||
*
|
||||
@@ -29,6 +33,12 @@ class UserController extends AbstractController implements UserControllerInterfa
|
||||
*/
|
||||
public function register(): Response
|
||||
{
|
||||
return $this->render("user/register.html.twig");
|
||||
$user = new User();
|
||||
$form = $this->createFormBuilder($user)
|
||||
->add('username', TextType::class)
|
||||
->add('password', PasswordType::class)
|
||||
->add('save', SubmitType::class,['label' => 'register'])
|
||||
->getForm();
|
||||
return $this->render("user/register.html.twig",['form'=>$form->createView()]);
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user