Browse Source

Passage des renderForm

François Drouhard 2 years ago
parent
commit
da11295b7d

+ 6 - 6
src/Controller/GenreController.php

@@ -42,8 +42,8 @@ class GenreController extends AbstractController
 			return $this->redirectToRoute('genre_liste');
 		}
 
-		return $this->render('genre/ajouter.html.twig', array(
-			'form'	=>	$form->createView(),
+		return $this->renderForm('genre/ajouter.html.twig', array(
+			'form'	=>	$form,
 		));
 	}
 
@@ -63,8 +63,8 @@ class GenreController extends AbstractController
 			return $this->redirectToRoute('genre_liste');
 		}
 
-		return $this->render('genre/modifier.html.twig', array(
-			'form'	=> $form->createView(),
+		return $this->renderForm('genre/modifier.html.twig', array(
+			'form'	=> $form,
             'genre'   =>  $genre,
             'films' => $films
 		));
@@ -84,9 +84,9 @@ class GenreController extends AbstractController
             return $this->redirectToRoute('genre_liste');
         }
 
-		return $this->render('genre/supprimer.html.twig', array(
+		return $this->renderForm('genre/supprimer.html.twig', array(
 			'genre'  =>  $genre,
-            'form'  =>  $form->createView()
+            'form'  =>  $form
 		));
 	}
 

+ 4 - 4
src/Controller/ProfilController.php

@@ -29,8 +29,8 @@ class ProfilController extends AbstractController
         }
 
 
-        return $this->render('profil/monprofil.html.twig', array (
-            'form'  =>  $form->createView()
+        return $this->renderForm('profil/monprofil.html.twig', array (
+            'form'  =>  $form
         ));
     }
 
@@ -49,8 +49,8 @@ class ProfilController extends AbstractController
             $this->addFlash('success', "Les préférences ont été modifiées");
         }
 
-        return $this->render('profil/mespreferences.html.twig', [
-            'form'  =>  $form->createView()
+        return $this->renderForm('profil/mespreferences.html.twig', [
+            'form'  =>  $form
         ]);
     }
 

+ 6 - 6
src/Controller/RealisateurController.php

@@ -41,8 +41,8 @@ class RealisateurController extends AbstractController
 			return $this->redirectToRoute('realisateur_liste');
 		}
 
-		return $this->render('realisateur/ajouter.html.twig', array(
-			'form'	=>	$form->createView()
+		return $this->renderForm('realisateur/ajouter.html.twig', array(
+			'form'	=>	$form
 		));
 	}
 
@@ -61,8 +61,8 @@ class RealisateurController extends AbstractController
 			return $this->redirectToRoute('realisateur_liste');
 		}
 
-		return $this->render('realisateur/modifier.html.twig', array(
-			'form'	=> $form->createView(),
+		return $this->renderForm('realisateur/modifier.html.twig', array(
+			'form'	=> $form,
             'realisateur'   =>  $realisateur
 		));
 	}
@@ -82,9 +82,9 @@ class RealisateurController extends AbstractController
             return $this->redirectToRoute('realisateur_liste');
         }
 
-		return $this->render('realisateur/supprimer.html.twig', array(
+		return $this->renderForm('realisateur/supprimer.html.twig', array(
 			'realisateur'  =>  $realisateur,
-            'form'  =>  $form->createView()
+            'form'  =>  $form
 		));
 	}
 

+ 14 - 14
src/Controller/SecurityController.php

@@ -62,8 +62,8 @@ class SecurityController extends AbstractController
             $this->addFlash('success', 'L\'utilisateur a été ajouté');
             return $this->redirectToRoute('admin_index');
         }
-        return $this->render('security/createuser.html.twig', array (
-            'form'  => $form->createView()
+        return $this->renderForm('security/createuser.html.twig', array (
+            'form'  => $form
         ));
     }
 
@@ -80,8 +80,8 @@ class SecurityController extends AbstractController
             $this->addFlash('success', 'L\'utilisateur a été modifié');
             return $this->redirectToRoute('admin_index');
         }
-        return $this->render('security/createuser.html.twig', array (
-            'form'  => $form->createView()
+        return $this->renderForm('security/createuser.html.twig', array (
+            'form'  => $form
         ));
     }
 
@@ -100,9 +100,9 @@ class SecurityController extends AbstractController
             return $this->redirectToRoute('admin_index');
         }
         
-        return $this->render('profil/preferences.html.twig', [
+        return $this->renderForm('profil/preferences.html.twig', [
             'user'  => $options->getUser(),
-            'form'  => $form->createView()
+            'form'  => $form
         ]);
     }
 
@@ -130,9 +130,9 @@ class SecurityController extends AbstractController
             $this->addFlash("success", "L'utilisateur a bien été supprimé");
             return $this->redirectToRoute('admin_index');
         }
-        return $this->render('security/supprimeruser.html.twig', array (
+        return $this->renderForm('security/supprimeruser.html.twig', array (
             'user'  =>  $user,
-            'form'  =>  $form->createView()
+            'form'  =>  $form
         ));
     }
 
@@ -156,8 +156,8 @@ class SecurityController extends AbstractController
             return $this->redirectToRoute('app_login');
         }
 
-        return $this->render('security/register.html.twig', array(
-            'form'  => $form->createView()
+        return $this->renderForm('security/register.html.twig', array(
+            'form'  => $form
         ));
     }
 
@@ -189,8 +189,8 @@ class SecurityController extends AbstractController
                 $this->addFlash('warning', "Cet email n'existe pas");
             }
         }
-        return $this->render('security/chercheruserpourpassword.html.twig', array (
-            'form'  =>  $form->createView()
+        return $this->renderForm('security/chercheruserpourpassword.html.twig', array (
+            'form'  =>  $form
         ));
     }
 
@@ -208,8 +208,8 @@ class SecurityController extends AbstractController
                     $this->addFlash('success', 'Mot de passe changé, veuillez vous connecter');
                     return $this->redirectToRoute('videotheque_liste');
                 }
-                return $this->render('security/password.html.twig', array(
-                    'form' => $form->createView()
+                return $this->renderForm('security/password.html.twig', array(
+                    'form' => $form
                 ));
             }
         }

+ 8 - 8
src/Controller/VideothequeController.php

@@ -92,8 +92,8 @@ class VideothequeController extends AbstractController
 			return $this->redirectToRoute('videotheque_voirfilm', array('id'=>$film->getId()));
 		}
 
-		return $this->render('videotheque/ajouter.html.twig', array(
-			'form'	=>	$form->createView(),
+		return $this->renderForm('videotheque/ajouter.html.twig', array(
+			'form'	=>	$form,
 		));
 	}
 
@@ -111,8 +111,8 @@ class VideothequeController extends AbstractController
 			return $this->redirectToRoute('videotheque_voirfilm',array('id'=>$film->getId()));
 		}
 
-		return $this->render('videotheque/modifier.html.twig', array(
-			'form'	=> $form->createView(),
+		return $this->renderForm('videotheque/modifier.html.twig', array(
+			'form'	=> $form,
 		));
 	}
 
@@ -131,9 +131,9 @@ class VideothequeController extends AbstractController
             return $this->redirectToRoute('videotheque_liste');
         }
 
-		return $this->render('videotheque/supprimer.html.twig', array(
+		return $this->renderForm('videotheque/supprimer.html.twig', array(
 			'film'  =>  $film,
-            'form'  =>  $form->createView()
+            'form'  =>  $form
 		));
 	}
 
@@ -161,9 +161,9 @@ class VideothequeController extends AbstractController
             $form = $this->createForm(CommentaireType::class, null);
         }
         
-        return $this->render('videotheque/voirfilm.html.twig', array(
+        return $this->renderForm('videotheque/voirfilm.html.twig', array(
             'film' => $film,
-            'form'  =>  $form->createView()
+            'form'  =>  $form
         ));
     }