コード例 #1
0
<?php

require_once "../includes/parametres.inc.php";
require_once "../includes/fonctions.inc.php";
//recherche du nom du controleur 'accueil' par défaut
$nomControleur = getParametre('controleur', 'accueil');
//recherche du nom de l'action 'index' par défaut
$action = getParametre('action', 'defaut');
// Formation du nom du contrôleur
$nomClasseControleur = getNomClasse('C', $nomControleur);
// Instanciation du controleur
$objetControleur = new $nomClasseControleur();
// Déclenchement de l'action
$objetControleur->{$action}();
コード例 #2
-1
 function afficherUneCateg()
 {
     $this->vue = new V_Vue("../vues/templates/template.inc.php");
     $daoCateg = new M_DaoCategorie();
     $daoCateg->connecter();
     $this->vue->ajouter('listeCateg', $daoCateg->getAll());
     $this->vue->ajouter('loginAuthentification', Session::getAuth('login'));
     $this->vue->ajouter('titreVue', "LAFLEUR : Produits par catégorie");
     $this->vue->ajouter('centre', "../vues/includes/accueil/centre.inc.php");
     if (Session::estAuthentifie(array('login'))) {
         $daoProduit = new M_DaoProduit();
         $daoProduit->connecter();
         $id = getParametre("id", "bul");
         // récupérer le libellé de la catégorie de produits
         $categ = $daoCateg->getOneById($id);
         $this->vue->ajouter('libelleCateg', $categ->getLibelle());
         $this->vue->ajouter('listeProduits', $daoProduit->getListeProduitsParCateg($id));
         $this->vue->ajouter('centre', "../vues/includes/produit/centreListe.inc.php");
         $daoProduit->deconnecter();
     } else {
         $this->vue->ajouter('message', "Vous n'êtes pas authentifié");
         $this->vue->ajouter('centre', "../vues/includes/accueil/centre.inc.php");
     }
     $daoCateg->deconnecter();
     $this->vue->afficher();
 }