-
Notifications
You must be signed in to change notification settings - Fork 3
Trailing slash control
sunrise-php edited this page Jan 7, 2019
·
2 revisions
Learn more about the middleware
composer require middlewares/trailing-slash
Path of a route should be as:
/**
* @Route(
* id="test",
* path="/test(/)",
* methods={"GET"}
* )
*/
class TestController implements MiddlewareInterface
{
// some code
}
Open the public/index.php
and add to the file the following code before running the application:
$container->get(Sunrise\Http\Router\RouterInterface::class)
->addMiddleware((new Middlewares\TrailingSlash(false))->redirect());
Have questions?
Ask your questions in our chat:
Get more features for your application using Awesome PSR-15 Middleware