-
Notifications
You must be signed in to change notification settings - Fork 0
/
twittyAjax.php
37 lines (28 loc) · 801 Bytes
/
twittyAjax.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
<?php
//nom de l'application
$nameApp = "twitty";
//action par défaut
$action = "login";
if(key_exists("action", $_REQUEST))
$action = $_REQUEST['action'];
require_once ('lib/core.php');
require_once ($nameApp.'/controller/mainController.php');
session_start();
$context = context::getInstance();
$context->init($nameApp);
$view = $context->executeAction($action, $_REQUEST);
// Inclusion de la vue
if($view == context::SUCCESS) {
$template_view = $nameApp."/view/".$action.$view.".php";
include($template_view);
}
// Traitement des erreurs
elseif($view == context::ERROR) {
echo context::ERROR . ":" . context::getSessionAttribute("erreur");
die;
}
else {
echo context::ERROR . ":Une grave erreur s'est produite, il est probable que l'action ".$action." n'existe pas...";
die;
}
?>