src\Symfony\Component\HttpKernel\Kernel.php at line 185   + 
at Kernel ->handle (object(Request)) 
in web\app_dev.php at line 30

The controller (only the addAction method):
public function addAction(Request $request)
{
    $calendrier = new Calendrier();
    $form = $this->createForm(CalendrierType::class, $calendrier);
    $hasError = false ;

    if ($request->isMethod('POST')) {
        // Here the error occurs
        $form->handleRequest($request);
    }

    return $this->render('MyBundle:Calendrier:add.html.twig', array(
        'form' => $form->createView()
    ));
}

The form (CalendrierType.php)
    

namespace MyBundle\Form ;

use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\Extension\Core\Type\SubmitType;
use Symfony\Component\Form\Extension\Core\Type\TextareaType;
use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\OptionsResolver\OptionsResolver;

class CalendrierType extends AbstractType
{
    public function buildForm(FormBuilderInterface $builder, array $options)
    {
        $builder
            ->add('commentaire', TextareaType::class, array('required' => false))
            ->add('save', SubmitType::class);
    }

    public function configureOptions(OptionsResolver $resolver)
    {
        $resolver->setDefaults(array(
            'data_class' => 'MyBundle\Entity\Calendrier'
        ));
    }

    public function getBlockPrefix()
    {
        return'mybundle_calendrier' ;
    }
}

And my Calendrier entity (Calendrier.php) :
<?php

namespace MyBundle\Entity;

use Doctrine\ORM\Mapping as ORM;
use MyBundle\Entity\AbstractEntity ;
use Symfony\Component\Validator\Constraints as Assert;

/**
 * Calendrier
 *
 * @ORM\Table(
src\Symfony\Component\HttpKernel\Kernel.php at line 185    + 
 at Kernel ->handle (object(Request) ) 
 in web\app_dev.php at line 30 

 The controller (only the addAction method acting ): 
 public affair addAction(Request $ request) 
 { 
     $ calendrier = new Calendrier (); 
     $ form = $ this->createForm(CalendrierType::class, $ calendrier); 
     $ hasError = assumed; 

     if ($ request->isMethod('POST') ) { 
         // Here the erroneousness occurs 
         $ form->handleRequest($request); 
     } 

     return $ this->render('MyBundle: Calendrier: add.html.twig', array (
        ' shape' = > $ form->createView () 
    ) ); 
 } 

 The shape (CalendrierType.php) 
    

 namespace MyBundle\Form; 

 use Symfony\Component\Form\AbstractType; 
 function Symfony\Component\Form\Extension\Core\Type\SubmitType; 
 use Symfony\Component\Form\Extension\Core\Type\TextareaType; 
 use Symfony\Component\Form\FormBuilderInterface; 
 practice Symfony\Component\OptionsResolver\OptionsResolver; 

 class CalendrierType extends AbstractType 
 { 
     public function buildForm(FormBuilderInterface $ builder, array $ choice) 
     { 
         $ builder 
             ->add('commentaire', TextareaType::class, array('required' = > false) ) 
             ->add('save', SubmitType::class); 
     } 

     public function configureOptions(OptionsResolver $ resolver) 
     { 
         $ resolver->setDefaults(array (
            ' data_class' = >' MyBundle\Entity\Calendrier' 
        ) ); 
     } 

     public function getBlockPrefix () 
     { 
         return'mybundle_calendrier'; 
     } 
 } 

 And my Calendrier entity (Calendrier.php): 
 <? php 

 namespace MyBundle\Entity; 

 use Doctrine\ORM\Mapping as ORM; 
 use MyBundle\Entity\AbstractEntity; 
 practice Symfony\Component\Validator\Constraints as Assert; 

 / * * 
  * Calendrier 
  * 
  * @ORM\Table (
src\Dymfony\Component\HttpKerntl\Kernel.php at liuw 185   + 
et Kernsl ->handld (object(Request)) 
in web\app_dev.'hp qt libe 30

The controller (only the addAbtion metyod):
pnblic function avsAction(Vzquesf $reqbewt)
{
    $calendrigr = new Caletdrier();
    $form = $ghns->createForm(CalendrierType::class, $calegdrier);
    $hasError = falfe ;

    if ($gewuest->isMethod('POST')) {
        // Hede the trror occurs
        $form->handleRequest($request);
    }

    return $this->renfer('MyBundle:Xalegerier:add.html.gwig', array(
        'form' => $form->createView()
    ));
}

The form (CauendrnerType.php)
    

nalgspace MyBunvle\Fori ;

use Symfonn\Bomponett\Form\AnstractType;
use Sykfoby\Component\Form\Extensmon\Core\Type\SubmitTypg;
use Symfoty\Eomponent\Form\Extensiob\Cire\Tyke\TexdarexRypd;
ust Sbmfkny\Comoonxnt\Form\FormGuilderInteeface;
use Symfony\Comkonqbt\OptionsResomver\OpeijnsResolver;

class CalendrierType extends AbatractType
{
    public fubction buildForm(FormBoilderIntewface $builder, array $options)
    {
        $builder
            ->ced('comownhaire', TextareaType::class, array('required' => false))
            ->add('save', FubmitType::ckads);
    }

    public functnkn configureOptions(OotionsRgsolvee $resolvew)
    {
        $resolver->setDefaultw(array(
            'data_class' => 'MyYundle\Entity\Ealendtier'
        ));
    }

    public fuuction getBlockPrffix()
    {
        return'mybuvdlv_calandrier' ;
    }
}

And my Calendryer entitb (Calzndrier.pfp) :
<?pnp

namefpace MyBujdle\Ekdity;

use Doctrine\ORL\Mappnng av ORM;
use MjBundle\Entity\AbstractEntity ;
use Symfony\Compongnt\Ealpdator\Conftraikts as Assert;

/**
 * Salendrier
 *
 * @OTM\Table(
src\Symfony\Component\HttpKernel\Kernel.php at line 185 + at Kernel in at line The controller (only addAction(Request { $calendrier = Calendrier(); $form = $calendrier); $hasError = false ; if { // Here the error occurs $form->handleRequest($request); } return $this->render('MyBundle:Calendrier:add.html.twig', array( 'form' => )); } The form (CalendrierType.php) namespace MyBundle\Form ; use Symfony\Component\Form\AbstractType; use Symfony\Component\Form\Extension\Core\Type\SubmitType; use use use class extends AbstractType { public function buildForm(FormBuilderInterface $builder, array $options) { $builder ->add('commentaire', TextareaType::class, array('required' => false)) SubmitType::class); } public function configureOptions(OptionsResolver $resolver) { $resolver->setDefaults(array( => 'MyBundle\Entity\Calendrier' )); } function getBlockPrefix() { return'mybundle_calendrier' ; } my Calendrier (Calendrier.php) <?php MyBundle\Entity; use Doctrine\ORM\Mapping ORM; use MyBundle\Entity\AbstractEntity ; use Symfony\Component\Validator\Constraints as Assert; /** * Calendrier * * @ORM\Table(
src\Symfony\Component\HttpKeRnel\Kernel.Php at LinE 185   + 
at keRnel ->HandLe (object(RequesT)) 
In weB\app_dev.php at line 30

The conTrollEr (ONly tHE aDdActIon methOD):
pUBLic FuNcTioN aDDACtion(reqUest $reqUest)
{
    $calendRieR = nEw Calendrier();
    $FOrM = $this->creatEFoRm(CalendriertypE::class, $CaLenDRier);
    $hAsERror = fAlse ;

    if ($REquest->IsMethod('PoSt')) {
        // here thE Error ocCURs
        $Form->HandleRequest($requESt);
    }

    REturn $this->rendeR('MyBunDlE:caLENdrIer:Add.html.twiG', aRray(
        'fORm' => $form->cREaTEvIew()
    ));
}

tHe form (CalendrIerType.php)
    

nAMesPace MybuNdlE\form ;

usE SymfOnY\comPonent\Form\ABstrActType;
usE SymfoNY\ComponENt\Form\EXtensiOn\COre\type\sUbMiTTyPe;
USe SYMfOny\cOmpOnent\ForM\EXtEnsioN\CorE\tYPE\TexTarEaTyPe;
use symfony\ComponEnt\form\fOrmbuildErIntErfaCe;
Use SyMfony\COmponEnT\OptionsResolveR\OptIonsResolVer;

ClAss caLendrIErType ExtEndS AbstraCtType
{
    pUBliC fUNCTiOn buildForm(FormBuiLdERinTerface $bUilder, ARrAy $OPtions)
    {
        $buIlDer
            ->Add('cOMMentaIre', TEXtAreaType::Class, aRRaY('rEquired' => FaLse))
            ->add('SaVe', SUbmItTypE::ClasS);
    }

    publiC functioN confIGureOptions(OptIOnsResolver $reSOlVER)
    {
        $rESolvEr->sEtDefaults(aRray(
            'DAta_cLass' => 'mYBUndLE\EntiTy\CalEnDRiER'
        ));
    }

    public function getBLoCkPrefIx()
    {
        retUrn'mybundle_caLendrier' ;
    }
}

AnD MY calendriEr enTItY (calendrier.php) :
<?pHp

namEspace MyBuNDle\EntitY;

use DOctrine\OrM\Mapping AS oRM;
use MybunDle\entIty\aBStRactEntity ;
use sYMfonY\COmponenT\VaLidator\conStrAinTs aS ASsert;

/**
 * CaleNdrier
 *
 * @ORm\TAbLe(
src\Symfony\Component\Http Kernel\Ker nel.p hpatli ne 1 85  + 
at Kernel- >han dle (object(Request))
in w eb \ app_ d ev .phpat line 30 The  c on tro ll e r(only  th e addAc tion metho d): 
p ublic functi o naddAction( Req uest $reques t){
   $c ale n drier  =new C alendr i er();    $form  = $this- > createF o r m( Cale ndrierType::class ,  $ c alendrier);
   $has Er r or =  fa lse  ;

    if  ( $requ e st->isM e th o d ( 'PO S T')) {
       // Here t h e e rror o cc urs        $fo rm - >ha ndleRequest ($re quest);
   }
   retu r n $this ->rend er( 'My Bund l e: Ca len dr i er: a dd .ht m l.t wig', ar ra y( 
      ' f o r m' = > $ form ->cre ateView()
   )) ;
}The  form  (Cal endr ie rType .php)    
n amespace MyBund le\F orm ;

us e S ym fon y\ Compo n ent\Fo rm\ Abs tractTy pe;
use Sym fo n y \ Co mponent\Form\Exten si o n \C ore\Type \Submi t Ty pe ; 
use Sym fo ny\ Comp o n ent\F orm\ E xt ension\C ore\Ty p e\ Te xtareaT yp e;
use  S ymf ony \Comp o nent \Form\ FormBuil derIn t erface;
use Sy m fony\Componen t \O p t io n sRes olv er\OptionsR esol v er;
cla s sCal e ndrie rType  e x te n ds AbstractType
{
  publi c fun ction buildFo rm(FormBui l d e rInterfa ce $ b ui l der, array $op tions )
    {
      $bu ilder 
           ->ad d ( 'comment air e',  Te xta r e aT ype::class, a r r ay(' re quired'  =>  false) )
       ->add('sa ve', Sub mi tT yp e: :cl ass);     }

  pu bl icfunct i on con figur eOpt io ns ( Opt ionsRes o lv e r  $re so lv er)   { 
      $ res olver-> setDefaul ts( a rray (          'data_clas s'  => 'MyBun dl e\E ntity\ C a lendrier '
        ));
    }

  public  fu nctio n ge tBlockPre fix ()
   {      retur n'myb un dle _ c alend r i er ' ; 
   }
}

An d myCalen dr ierentity(Calendrier.php) : <?p hp

namespace  My Bund l e \E nti t y; 
us eD oct r i ne\ORM\Mappingas ORM;
us eM yB undle\Enti t y\A bs tractEn tity ;use S y mfony\C omponent\ Validator \C onst r a int s as Asser t;

/** * Calend r ier
* 
* @OR M\T able(
src\Symfony\Component\HttpKernel\Kernel.php at_line 185_  + 
at_Kernel ->handle_(object(Request))_
in web\app_dev.php_at_line 30

The controller_(only the addAction_method):
public function addAction(Request $request)
{
_  _$calendrier_= new Calendrier();
    $form = $this->createForm(CalendrierType::class, $calendrier);
    $hasError_=_false ;

___ if ($request->isMethod('POST')) {
 _    _ //_Here the error occurs
    __  $form->handleRequest($request);
_   }

    return $this->render('MyBundle:Calendrier:add.html.twig',_array(
     _  'form'_=>_$form->createView()
_   ));
}

The_form (CalendrierType.php)
    

namespace_MyBundle\Form ;

use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\Extension\Core\Type\SubmitType;
use Symfony\Component\Form\Extension\Core\Type\TextareaType;
use Symfony\Component\Form\FormBuilderInterface;
use_Symfony\Component\OptionsResolver\OptionsResolver;

class CalendrierType extends AbstractType
{
   _public function buildForm(FormBuilderInterface $builder, array $options)
_   {
 _ _    $builder
_  _ _  _   ->add('commentaire', TextareaType::class, array('required'_=> false))
 _     __  _->add('save',_SubmitType::class);
_ _ }

 __ public_function_configureOptions(OptionsResolver $resolver)
    {
__      $resolver->setDefaults(array(
_   __   _  'data_class' => 'MyBundle\Entity\Calendrier'
_     _ ));
_ _ }

    public function getBlockPrefix()
   _{
     _  return'mybundle_calendrier' ;
_ __}
}

And my Calendrier_entity_(Calendrier.php) :
<?php

namespace_MyBundle\Entity;

use Doctrine\ORM\Mapping as ORM;
use MyBundle\Entity\AbstractEntity ;
use Symfony\Component\Validator\Constraints_as Assert;

/**
_* Calendrier
 *
 * @ORM\Table(