示例#1
0
文件: index.php 项目: aheinze/lime
<?php

require_once "src/Lime/App.php";
$app = new Lime\App();
$app->bind("/", function () use($app) {
    return "Hello World!";
});
$app->run();
示例#2
0
    return $app->render('views/static_content.php with views/layout.php', ['title' => 'Contact', 'description' => "It's easy to connect with Fisher Evans: E-Mail, Twitter, LinkedIn, GitHub, the works!", 'currentPage' => 'contact', 'staticContent' => $staticContent]);
});
$app->bind("/credits", function () use($app) {
    $staticContent = collection('Static Content')->findOne(['name_slug' => 'credits']);
    return $app->render('views/static_content.php with views/layout.php', ['title' => 'Credits', 'description' => "I wouldn't have been able to make this site without a little help...", 'currentPage' => '', 'staticContent' => $staticContent]);
});
$app->bind("/resume", function () use($app) {
    global $app;
    $app->response->status = "301";
    header('Location: http://resume.fisherevans.com/');
    $data = ['title' => '404 Not Found', 'description' => 'This page was not found. Please let me know if you this is in error.', 'message' => 'My resume is now located here: <a href="http://resume.fisherevans.com/">resume.fisherevans.com/</a>.'];
    return $app->render('views/404.php with views/layout.php', $data);
});
$app->bind("/sitemap.xml", function () use($app) {
    return $app->render('views/indexes/sitemap.php', ['app' => $app]);
});
$app->bind("/blog/rss", function () use($app) {
    return $app->render('views/indexes/rss.php', ['app' => $app]);
});
$app->bind("*", function () use($app) {
    return get404();
});
if (isset($_SERVER['ORIG_PATH_INFO'])) {
    $app->run($_SERVER['ORIG_PATH_INFO']);
} else {
    if (isset($_SERVER['REQUEST_URI'])) {
        $app->run($_SERVER['REQUEST_URI']);
    } else {
        $app->run('/');
    }
}