SlimTurbo is an add on to Slim to enable full route caching
Slim Turbo is an extension to Slim Framework that allows you to cache the Route names and Routes directly in a compiled Dependency Injection container.
It's recommended to use Slim without this package, for DI containers that do not compile.
It's recommended to use Composer to install Slim Turbo.
$ composer require dlundgren/slim-turbo:^1.0
This will install Slim Turbo and all required dependencies. Like Slim, Slim Turbo requires PHP 7.1.
Create a class that extends Slim\Turbo\Provider\RouteProvider and implement
register() method. Routes are defined similarly to using
Slim\App and it's recommended to use class names,
service names, or strings when adding middleware and route callables. These will be loaded from the Container as
NOTE Closures may be used with SlimTurbo, but it's recommended to only use them while in development. It is undefined behavior (from SlimTurbo's perspective) to use Closures in production.
In order to cache the route information that is generated you MUST set a
routing.cache key in your DI
container to a SimpleCache implementation.
Slim Turbo provides service providers for the following Dependency Injection containers:
Please see CONTRIBUTING for details.
If you discover security related issues, please email firstname.lastname@example.org instead of using the issue tracker.
Slim Turbo is licensed under the MIT license. See License File for more information.