Ejemplo n.º 1
0
session_start();
$controller = '';
$action = '';
$type = '';
require_once $_SERVER['DOCUMENT_ROOT'] . 'boutique/views/header.php';
if (!empty($_GET['c']) && !empty($_GET['a'])) {
    $controller = $_GET['c'];
    $action = $_GET['a'];
}
if (!empty($_GET['t'])) {
    $type = $_GET['t'];
}
if ($controller == '' && $action == '') {
    require_once $_SERVER['DOCUMENT_ROOT'] . 'boutique/controllers/article.php';
    $controller_article = new Controller_Article();
    $controller_article->listArticleHome();
} elseif ($controller == 'articles' && $action == 'list' && $type == '') {
    require_once $_SERVER['DOCUMENT_ROOT'] . 'boutique/controllers/article.php';
    $controller_article = new Controller_Article();
    $controller_article->listArticle();
    require_once $_SERVER['DOCUMENT_ROOT'] . 'boutique/views/articles/list.php';
} elseif ($controller == 'articles' && $action == 'list' && $type == 'categorie') {
    require_once $_SERVER['DOCUMENT_ROOT'] . 'boutique/controllers/article.php';
    $controller_articleCat = new Controller_Article();
    $controller_articleCat->listArticleByCategorie();
} elseif ($controller == 'articles' && $action == 'list' && $type == 'licence') {
    require_once $_SERVER['DOCUMENT_ROOT'] . 'boutique/controllers/article.php';
    $controller_articleLi = new Controller_Article();
    $controller_articleLi->listArticleByLicence();
} elseif ($controller == 'articles' && $action == 'recherche') {
    require_once $_SERVER['DOCUMENT_ROOT'] . 'boutique/controllers/recherche.php';