Paaxio 1.0
Plateforme de streaming musical - SAE IUT Bayonne
Chargement...
Recherche...
Aucune correspondance
controller_factory.class.php
Aller à la documentation de ce fichier.
1<?php
2
21{
34 public static function getController($controller, \Twig\Loader\FilesystemLoader $loader, \Twig\Environment $twig)
35 {
36 $controllerName = "Controller" . ucfirst($controller);
37 if (!class_exists($controllerName)) {
38 throw new Exception("Le controller $controllerName n'existe pas");
39 }
40 return new $controllerName($twig, $loader);
41 }
42}
Fabrique pour la création dynamique de contrôleurs.
static getController($controller, \Twig\Loader\FilesystemLoader $loader, \Twig\Environment $twig)
Crée et retourne une instance du contrôleur demandé.
$twig
Environnement Twig configuré
Definition twig.php:32
$loader
Chargeur de fichiers Twig.
Definition twig.php:21