Beispiel #1
0
$routes->get('/profile-:id', function ($id) {
    $content = UserController::getProfile($id);
    $user = $content["user"];
    if ($user->username == null) {
        $content["error"] = "User doesn't exist";
        BaseController::set_flash($content);
        Redirect::to("/");
    }
    View::make("profile.html", $content);
});
$routes->get('/recent', function () {
    $content = ImageController::getMostRecentImages(0);
    View::make("home.html", $content);
});
$routes->get('/recent-:id', function ($id) {
    $content = ImageController::getMostRecentImages($id);
    View::make("home.html", $content);
});
$routes->get('/popular', function () {
    $content = ImageController::getMostPopularImages(0);
    View::make("home.html", $content);
});
$routes->get('/unrated', function () {
    $content = ImageController::getUnratedImages(0);
    View::make("home.html", $content);
});
$routes->get('/unrated-:id', function ($id) {
    $content = ImageController::getUnratedImages($id);
    View::make("home.html", $content);
});
$routes->get('/popular-:id', function ($id) {