add chapter 12 solutions
This commit is contained in:
parent
f857fa4752
commit
ebbcc6e7f6
23 changed files with 1998 additions and 0 deletions
12
implementation/12/config/routes.php
Normal file
12
implementation/12/config/routes.php
Normal file
|
@ -0,0 +1,12 @@
|
|||
<?php declare(strict_types=1);
|
||||
|
||||
use FastRoute\RouteCollector;
|
||||
use Lubian\NoFramework\Action\Hello;
|
||||
use Lubian\NoFramework\Action\Other;
|
||||
use Psr\Http\Message\ResponseInterface;
|
||||
|
||||
return function (RouteCollector $r) {
|
||||
$r->addRoute('GET', '/hello[/{name}]', Hello::class);
|
||||
$r->addRoute('GET', '/other', [Other::class, 'handle']);
|
||||
$r->addRoute('GET', '/', fn (ResponseInterface $r) => $r->withHeader('Location', '/hello') ->withStatus(302));
|
||||
};
|
Loading…
Add table
Add a link
Reference in a new issue