Beispiel #1
0
$routes->get('/player/list', 'check_logged_in', function () {
    // Not implemented yet
    // PlayerController::list_players();
});
// Infosivu
$routes->get('/info', function () {
    PlayerController::info();
});
// Välimuistisivujen poisto (vain admin)
$routes->get('/clearcache', 'check_admin_logged_in', function () {
    Cache::clear();
    Redirect::to('/', array('message' => 'Sivujen välimuisti poistettu.'));
});
// Kuvaajat
$routes->get('/graphs', 'check_logged_in', function () {
    GraphController::index();
});
// Käyttäjä
// Kirjautumislomakkeen esittäminen
$routes->get('/login', function () {
    UserController::login();
});
// Kirjautumisen käsittely
$routes->post('/login', function () {
    UserController::handle_login();
});
// Uloskirjautuminen
$routes->post('/logout', function () {
    UserController::logout();
});
// Rekisteröitymislomakkeen esittäminen
<?php

header("Content-Type:application/json");
include '../controller/GraphController.php';
$graph = new GraphController();
$graph->render();
?>