menuvue = new Menuvueutilisateur(); $this->menuvue->getMenuTbajout('service'); $this->service = new service(); } public function index() { $chemin = $this->menuvue->getChemin('service'); $this->genererVue(array('chemin' => $chemin)); } public function ajouter() { $codeSociete = $this->requete->getSession()->getAttribut('codeSociete'); $codeService = $this->requete->getParametre("codeService"); // Début contrôle doublon if (!$this->service->existeligne($codeService)) { $libelle = $this->requete->getParametre("libelle"); $codeService = strtoupper($codeService); $libelle = ucfirst($libelle); $this->service->ajouter($codeSociete, $codeService, $libelle); $this->executerAction("index"); } else $this->genererVue(array('msgErreur' => 'Ce code existe déjà!'), "index"); // Fin doublon } }