Exemple #1
0
<?php

use Stratify\ErrorHandlerModule\ErrorHandlerMiddleware;
use Stratify\Framework\Application;
use function Stratify\Framework\pipe;
use function Stratify\Framework\router;
require __DIR__ . '/../vendor/autoload.php';
// Current bug in Puli
require_once __DIR__ . '/../.puli/GeneratedPuliFactory.php';
$http = pipe([ErrorHandlerMiddleware::class, router('/app/config/routes.php')]);
$modules = ['error-handler', 'twig', 'app'];
$app = new Application($modules, 'dev', $http);
$app->http()->run();
Exemple #2
0
<?php

use Stratify\ErrorHandlerModule\ErrorHandlerMiddleware;
use Stratify\Framework\Application;
use function Stratify\Framework\pipe;
use function Stratify\Framework\router;
require __DIR__ . '/vendor/autoload.php';
// Current bug in Puli
require_once __DIR__ . '/.puli/GeneratedPuliFactory.php';
$http = pipe([ErrorHandlerMiddleware::class, router(['/' => function (Twig_Environment $twig) {
    return $twig->render('/app/views/home.twig');
}])]);
$modules = ['error-handler', 'twig', 'app'];
$app = new Application($modules, 'dev', $http);
$app->http()->run();