コード例 #1
0
ファイル: index.php プロジェクト: alexxandar/PHPhilosophy
<?php

use Phphilosophy\Phphilosophy;
/*
 * Phphilosophy index file
 *
 * @author      Lisa Saalfrank <*****@*****.**>
 * @copyright   2015 PHPhilosophy
 * @license	    http://opensource.org/licenses/MIT MIT License
 */
require $_SERVER['DOCUMENT_ROOT'] . '/../bootstrap/bootstrap.php';
$app = new Phphilosophy();
/*
 * PLEASE ADD YOUR ROUTES HERE
 */
$app->get('/', function () {
    echo 'Welcome to PHPhilosophy!';
});
/*
 * HERE YOU CAN CUSTOMIZE YOUR ERROR PAGE
 */
$app->notFound(function () {
    echo 'The page you requested could not be found!';
});
$app->run();
コード例 #2
0
ファイル: index.php プロジェクト: Phieleia/PHPhilosophy
<?php

use Phphilosophy\Phphilosophy;
use Phphilosophy\Http\Request;
/*
 * Phphilosophy index file
 *
 * @author      Lisa Saalfrank <*****@*****.**>
 * @copyright   2015-2016 Lisa Saalfrank
 */
require __DIR__ . '/../bootstrap/bootstrap.php';
$request = new Request();
Phphilosophy::register($request);
/*
 * PLEASE ADD YOUR ROUTES HERE
 */
Phphilosophy::get('/', function () {
    echo 'Welcome to PHPhilosophy!';
});
/*
 * HERE YOU CAN CUSTOMIZE YOUR ERROR PAGE
 */
Phphilosophy::notFound(function () {
    echo 'The page you requested could not be found!';
});
Phphilosophy::run();