Download the PHP package bnf/slim-typo3 without Composer
On this page you can find all versions of the php package bnf/slim-typo3. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Informations about the package slim-typo3
Slim Framework integration for TYPO3
Introduction
This extension provides a TYPO3 RequestHandler which runs a Slim App. The Slim App will be executed when one of its routes match the request. If no route matches, the lower prioritized default TYPO3 RequestHandler(s) will be executed.
This request handler basically works like a TYPO3 eID (executed with identically environment), but with proper routing and nice looking URLs.
Note: The EIDRequestHandler has higher priority and will not
be influenced by this router. That means the slim app
can not accept a GET parameter eID
.
Usage
Quick Example
Register the app definition in ext_localconf.php (or AdditionalConfiguration.php):
That's all and now your route controller should be executed when requesting /hello/world
.
Full Example
- TODO: Configuration/Services.yaml – tag based registration
ext_localconf.php:
TestApp.php
Example Extension
See https://github.com/bnf/slim-typo3-testapp for an example extension.
TODO
Support generating multiple RequestsHandlers with multiple App configs? (and maybe basePaths). (Well, maybe not. Con: that add's another abstraction on top of Slim\App which already knows about route groups – BUT it would support different Middleware configs.)
Example:
Suggestions
For this TYPO3 integration we suggest to add middleware's as string.
That has a slight overhead as Slim's CallableResolver
will preg_match
the string, but has the advantage, that not all middleware's
need to be instantiated although they may never be called (as no route matches
and we do not process the request). As TYPO3 is the host
it's likely that most of the times the TYPO3 RequestHandlers will be executed
therefore the slim bootstrap should be as lightweight as possible.
You can supply middleware's as class (or container identifier) strings
and Slim's CallableResolver
will retrieve the instance
from the container (if the container has a definition for that class)
or instantiate a new class: new $class($container);
Therefore use:
instead of:
All versions of slim-typo3 with dependencies
psr/http-message Version ^1.0
psr/http-server-middleware Version ^1.0
slim/slim Version ^3.0
bnf/slim3-psr15 Version ^1.0
pimple/pimple Version ^3.2