49 lines
2.0 KiB
PHP
49 lines
2.0 KiB
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
use Psr\Container\ContainerInterface;
|
|
use Zend\Expressive\Application;
|
|
use Zend\Expressive\MiddlewareFactory;
|
|
|
|
/**
|
|
* Setup routes with a single request method:
|
|
*
|
|
* $app->get('/', App\Handler\HomePageHandler::class, 'home');
|
|
* $app->post('/album', App\Handler\AlbumCreateHandler::class, 'album.create');
|
|
* $app->put('/album/:id', App\Handler\AlbumUpdateHandler::class, 'album.put');
|
|
* $app->patch('/album/:id', App\Handler\AlbumUpdateHandler::class, 'album.patch');
|
|
* $app->delete('/album/:id', App\Handler\AlbumDeleteHandler::class, 'album.delete');
|
|
*
|
|
* Or with multiple request methods:
|
|
*
|
|
* $app->route('/contact', App\Handler\ContactHandler::class, ['GET', 'POST', ...], 'contact');
|
|
*
|
|
* Or handling all request methods:
|
|
*
|
|
* $app->route('/contact', App\Handler\ContactHandler::class)->setName('contact');
|
|
*
|
|
* or:
|
|
*
|
|
* $app->route(
|
|
* '/contact',
|
|
* App\Handler\ContactHandler::class,
|
|
* Zend\Expressive\Router\Route::HTTP_METHOD_ANY,
|
|
* 'contact'
|
|
* );
|
|
*/
|
|
return function (Application $app, MiddlewareFactory $factory, ContainerInterface $container) : void {
|
|
$app->get('/', App\Handler\HomePageHandler::class, 'home');
|
|
$app->get('/api/ping', App\Handler\PingHandler::class, 'api.ping');
|
|
|
|
$app->get('/the-prize', App\Handler\HomePageHandler::class, 'the-prize');
|
|
$app->get('/the-prize/background-and-purpose', App\Handler\HomePageHandler::class, 'the-prize.bg');
|
|
$app->get('/the-prize/description-and-values', App\Handler\HomePageHandler::class, 'the-prize.desc');
|
|
$app->get('/the-prize/aspect-for-selection', App\Handler\HomePageHandler::class, 'the-prize.aspect');
|
|
$app->get('/the-prize/gran-prize-award-events', App\Handler\HomePageHandler::class, 'the-prize.events');
|
|
|
|
$app->get('/judges', App\Handler\HomePageHandler::class, 'judges');
|
|
$app->get('/awardees', App\Handler\HomePageHandler::class, 'awardees');
|
|
$app->get('/awardees/{year:\d+}', App\Handler\HomePageHandler::class, 'awardees-by-year');
|
|
};
|