<commit_before><?php

namespace Etna\SocialBundle\Controller;

use Symfony\Bundle\FrameworkBundle\Controller\Controller;
use Etna\SocialBundle\Entity\Membre;

class DefaultController extends Controller
{
    public function indexAction($name)
    {
        return $this->render('EtnaSocialBundle:Default:index.html.twig', array('name' => $name));
    }
    public function ajouterAction()
    {
    	$membre = new Membre();

    	$formBuilder = $this->createFormBuilder($membre);
    	$formBuilder
    		->add('nom', 'text')
    		->add('prenom', 'text')
    		->add('genre', 'choice', array(
    'choices'   => array('m' => 'Homme', 'f' => 'Femme'),
    ))
    		->add('email', 'email')
    		->add('password', 'password');
		$form = $formBuilder->getForm();
		return $this->render('EtnaSocialBundle:Default:newcompte.html.twig', array('form' => $form->createView(),
			));
    }
}<commit_msg>Reel création d'utilisateur<commit_after><?php

namespace Etna\SocialBundle\Controller;

use Symfony\Bundle\FrameworkBundle\Controller\Controller;
use Etna\SocialBundle\Entity\Membre;

class DefaultController extends Controller
{
    public function indexAction($name)
    {
        return $this->render('EtnaSocialBundle:Default:index.html.twig', array('name' => $name));
    }
    public function ajouterAction()
    {
    	$membre = new Membre();

    	$formBuilder = $this->createFormBuilder($membre);
    	$formBuilder
            ->add('username', 'text')
    		->add('nom', 'text')
    		->add('prenom', 'text')
    		->add('genre', 'choice', array(
                'choices'   => array('m' => 'Homme', 'f' => 'Femme'),
                ))
    		->add('email', 'email')
    		->add('password', 'password');
		$form = $formBuilder->getForm();
        $request = $this->get('request');

        if ($request->getMethod() == 'POST') {
            $form->bind($request);
            if ($form->isValid()) {
                $em = $this->getDoctrine()->getManager();
                $em->persist($membre);
                $em->flush();

                return $this->redirect($this->generateUrl('etna_social_login'));
            }     
        }
        $form->bind($request);
		return $this->render('EtnaSocialBundle:Default:newcompte.html.twig', array('form' => $form->createView(),
			));
    }
}
{'fraction_non_alphanumeric': 0.18482999128160418, 'fraction_numerical': 0.0, 'mean_word_length': 2.9297945205479454, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 45, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4039564', 'n_tokens_mistral': 754, 'n_tokens_neox': 726, 'n_words': 117}