if ($method == 'get') { switch ($uri) { case "/": $frontController = new FrontController(); $frontController->index(); break; case preg_match('/\\/product\\/([1-9][0-9]*)/', $uri, $m) == 1: $front = new Controllers\FrontController(); $front->show($m[1]); break; case "/cart": $front = new Controllers\FrontController(); $front->showCart(); break; case "/store": $front = new Controllers\FrontController(); $front->store(); break; default: $message = 'Page Not Found'; view('404', compact('message')); } } if ($method == 'post') { switch ($uri) { case '/command': $front = new Controllers\FrontController(); $front->command(); break; } }
$frontController->dashboard(); break; case "/logout": $frontController = new FrontController(); $frontController->logout(); break; default: $message = 'Page Not Found'; view('404', compact('message'), '404 Not Found'); } } if ($method == 'post') { switch ($uri) { case "/command": $frontController = new FrontController(); $frontController->store($cart); break; case "/modify": $frontController = new FrontController(); $frontController->modify($cart); break; case "/finalize": $frontController = new FrontController(); $frontController->finalize($cart); break; case "/login": $frontController = new FrontController(); $frontController->login(); break; } }
\* ------------------------------------------------- */ use Controllers\FrontController; /* ------------------------------------------------- *\ Router \* ------------------------------------------------- */ if ($method == 'get') { switch ($uri) { case "/": //echo "page d'accueil"; $frontController = new FrontController(); $frontController->index(); break; // /casque/1 ou laser/2 ou laser/1 ... // /casque/1 ou laser/2 ou laser/1 ... case preg_match('/product\\/([1-9][0_9]*)/', $uri, $m) == 1: $front = new Controllers\FrontController(); $front->show($m[1]); break; case "/cart": $frontController = new FrontController(); $frontController->showCart(); break; case preg_match('/\\/category\\/([1-9][0-9]*)/', $uri, $m) == 1: $frontController = new Controllers\FrontController(); $frontController->showCategory($m[1]); break; default: $message = 'Not Found !'; view('front.404', compact('message'), '404 Not Found'); } }
$front->Show($m[1]); break; // catégories // catégories case preg_match('/\\/category\\/([1-9][0-9]*)/', $uri, $m) == 1: $frontController = new Controllers\FrontController(); $frontController->showCategory($m[1]); break; /* formulaire */ /* formulaire */ case "/cart": $frontController = new Controllers\FrontController(); $frontController->showCart(); break; default: $message = 'Page Not Found'; view('front.404', compact('message'), '404 Not Found'); } } if ($method == 'post') { switch ($uri) { case "/command": $frontController = new Controllers\FrontController(); $frontController->command(); break; case "/store": $frontController = new Controllers\FrontController(); $frontController->store(); break; } }
\* ------------------------------------------------- */ if ($method == 'get') { switch ($uri) { case "/": //echo "page d'accueil"; $frontController = new Controllers\FrontController(); $frontController->index(); break; // /casque/1 ou laser/2 ou laser/1 ... // /casque/1 ou laser/2 ou laser/1 ... case preg_match('/\\/product\\/([1-9][0-9]*)/', $uri, $m) == 1: $frontController = new Controllers\FrontController(); $frontController->show($m[1]); break; case "/cart": $frontController = new Controllers\FrontController(); $frontController->showCart(); break; default: $message = 'Not Found !'; view('front.404', compact('message'), '404 Not Found'); } } if ($method == 'post') { switch ($uri) { case '/command': $frontController = new FrontController(); $frontController->command(); break; case '/store': $frontController = new FrontController();