mirror of
https://github.com/flextype/flextype.git
synced 2025-08-17 18:36:39 +02:00
feat(site-plugin): add TrailingSlash Middlewares
This commit is contained in:
@@ -38,3 +38,8 @@ include_once 'routes/web.php';
|
||||
* Include dependencies
|
||||
*/
|
||||
include_once 'dependencies.php';
|
||||
|
||||
/**
|
||||
* Include Middlewares
|
||||
*/
|
||||
include_once 'middlewares.php';
|
||||
|
@@ -16,7 +16,9 @@
|
||||
"issues": "https://github.com/flextype/issues"
|
||||
},
|
||||
"require": {
|
||||
"php": ">=7.2.0"
|
||||
"php": ">=7.2.0",
|
||||
"ext-json": "*",
|
||||
"middlewares/trailing-slash": "~1.1.0"
|
||||
},
|
||||
"config": {
|
||||
"apcu-autoloader": true,
|
||||
|
17
site/plugins/site/middlewares.php
Normal file
17
site/plugins/site/middlewares.php
Normal file
@@ -0,0 +1,17 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
/**
|
||||
* Flextype (http://flextype.org)
|
||||
* Founded by Sergey Romanenko and maintained by Flextype Community.
|
||||
*/
|
||||
|
||||
namespace Flextype;
|
||||
|
||||
use Middlewares\TrailingSlash;
|
||||
|
||||
/**
|
||||
* Add middleware TrailingSlash for all routes
|
||||
*/
|
||||
$app->add((new TrailingSlash(false))->redirect(true));
|
Reference in New Issue
Block a user