get('/?', function(){ header('Location: dashboard'); }); $R->get('dashboard/:submenu/?', function($sm){ $subMenu = $sm; include __ROOT__.'/view.php'; }); $R->get('machines/:submenu/?', function($sm){ $subMenu = $sm; include __ROOT__.'/view.php'; }); $R->get('users/:submenu/?', function($sm){ $subMenu = $sm; include __ROOT__.'/view.php'; }); $R->get('sync/:submenu/?', function($sm){ $subMenu = $sm; include __ROOT__.'/view.php'; }); $R->get('settings/:submenu/?', function($sm){ $subMenu = $sm; include __ROOT__.'/view.php'; }); $R->get('dashboard/?', function(){ $subMenu = 'index'; include __ROOT__.'/view.php'; }); $R->get('machines/?', function(){ $subMenu = 'index'; include __ROOT__.'/view.php'; }); $R->get('users/?', function(){ $subMenu = 'index'; include __ROOT__.'/view.php'; }); $R->get('sync/?', function(){ $subMenu = 'index'; include __ROOT__.'/view.php'; }); $R->get('settings/?', function(){ $subMenu = 'index'; include __ROOT__.'/view.php'; }); $R->post('.*', function(){ echo 'Acces POST'; }); /* [2] On lance le routeur ===================================================*/ $R->run(); ?>