You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
ProjetPHP/controller/UserCtrl.php

57 lines
1.4 KiB

<?php
class CtrlUser
{
private $model;
private $view;
private $con;
public function __construct(TaskModel $model, HomeView $view,
Connection $con){
session_start();
$this->model = $model;
$this->view = $view;
$this->con = $con;
}
public function handleAction(){
try{
$action=$_REQUEST['action'];
switch($action){
// pas d'action afficher la home page avec toutes les listes
case NULL:
$this->home();
break;
// ajouter une liste publique
case 'creer_liste_pub':
$this->newList('private');
break;
// ajouter une liste privee
case 'creer_liste_priv':
$this->newList('public');
break;
// supprimer une liste
case 'supprimer_liste':
$this->delList();
break;
// changer nom de la liste
case 'changer_nom':
$this->changeListName();
break;
// ajouter une tache
// completer tache
}
} catch(Exception $e) {
require("../view/erreur.php");
}
}
}
?>