_A_urlDecortique['controleur'] = array_shift($A_urlDecortique); // on recupere le contrôleur $this->_A_urlDecortique['action'] = array_shift($A_urlDecortique); // puis l'action // ...on stocke ces éventuels parametres dans la variable d'instance qui leur est réservée $this->_A_urlParametres = $A_urlDecortique; // On s'occupe du tableau $A_postParams $this->_A_postParams = $A_postParams; } // On exécute notre triplet public function executer() { if (!class_exists($this->_A_urlDecortique['controleur'])) { throw new ControleurException($this->_A_urlDecortique['controleur'] . " n'est pas un controleur valide."); } if (!method_exists($this->_A_urlDecortique['controleur'], $this->_A_urlDecortique['action'])) { throw new ControleurException($this->_A_urlDecortique['action'] . " du contrôleur " . $this->_A_urlDecortique['controleur'] . " n'est pas une action valide."); } $B_called = call_user_func_array(array(new $this->_A_urlDecortique['controleur'], $this->_A_urlDecortique['action']), array($this->_A_urlParametres, $this->_A_postParams )); if (false === $B_called) { throw new ControleurException("L'action " . $this->_A_urlDecortique['action'] . " du contrôleur " . $this->_A_urlDecortique['controleur'] . " a rencontré une erreur."); } } }