Esempio n. 1
0
<?php

function check_logged_in()
{
    BaseController::check_logged_in();
}
$routes->get('/', function () {
    ThreadController::threadList();
});
//Thread
$routes->post('/thread', 'check_logged_in', function () {
    ThreadController::addThread();
});
$routes->post('/thread/:id/edit', function ($id) {
    BaseController::check_thread_rights($id);
    ThreadController::updateThread($id);
});
$routes->post('/thread/:id/destroy', function ($id) {
    BaseController::check_admin();
    ThreadController::destroyThread($id);
});
$routes->get('/thread', function () {
    ThreadController::threadList();
});
$routes->get('/thread/create', 'check_logged_in', function () {
    ThreadController::createThread();
});
$routes->get('/thread/:id', function ($id) {
    ThreadController::showThread($id);
});
$routes->get('/thread/:id/participants', function ($id) {