AutenticacionController.php
1.29 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
<?php
namespace UBV\AutenticacionBundle\Controller;
use Symfony\Bundle\FrameworkBundle\Controller\Controller;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Template;
use Symfony\Component\HttpFoundation\Request;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Method;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\ParamConverter;
use UBV\AutenticacionBundle\Form\Type\RegistroAspiranteType;
use Symfony\Component\HttpFoundation\RedirectResponse;
class AutenticacionController extends Controller {
/**
* @Route("/", name="autenticacion_principal")
* @Template()
*/
public function principalAction() {
return $this->render('UBVAutenticacionBundle::inicio.html.twig');
}
/**
* @Route("/aspirante/registro/", name="registro_aspirante")
* @Method({"GET", "POST"})
*/
public function registroAspiranteAction(Request $request) {
$form = $this->createForm(RegistroAspiranteType::class);
$form->handleRequest($request);
if ($form->isSubmitted() && $form->isValid()) {
return $this->forward('UBVAutenticacionBundle:Registration:Register');
}
return $this->render('UBVAutenticacionBundle:Registration:registro_aspirante.html.twig', array(
'form' => $form->createView()
));
}
}