Download the PHP package b13/slimphp-bridge without Composer
On this page you can find all versions of the php package b13/slimphp-bridge. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Informations about the package slimphp-bridge
SlimPHP - TYPO3 Bridge Extension
Boot up a SlimPHP application within a PSR-15 middleware of the TYPO3 Frontend Request.
There are two things you need for this:
- Create your endpoints with a SlimPHP
RequestResponseArgs
strategy in PHP - Configure your endpoints in your site configuration file
Clear caches and you should be good to go.
Description
TYPO3 v9 offers a flexible way to hook into the Frontend Rendering process and do something completely different - thanks to PSR-7 and PSR-15.
SlimPHP is also based on the PSR standards and is a perfect fit if a TYPO3 developer needs to integrate a proper API via e.g. REST.
This small wrapper extension helps to get going very quickly when needing a small API layer for arbitrary endpoints. It is not meant to become a fully headless solution for TYPO3 as a CMS.
However, a TYPO3 PHP developer should be familiar with starting off really quickly to handle custom endpoints without having to write TypoScript.
Installation
Install it via composer req b13/slimphp-bridge
(currently composer-only as some PHP dependencies
are needed).
Activate the extension in the backend of TYPO3.
Configuration
Then adapt your site configuration to add custom routes.
The type: slim
entry enables a SlimPHP Application. The current Site object
is then available in the request object.
`
The configuration is similar to what you can do with SlimPHP and with TYPO3, and your controllers just follow
the RequestResponseArgs
strategy pattern in SlimPHP.
Once you create your endpoints (callbacks), clear your caches and you can run your installation directly.
TYPO3 10.4: If you wan't to use DI in your callbacks, you will have to make them public in the DI configuration:
Currently, the extension ships with Tobias Nyholm's PSR implementation, as this provides proper PSR-17 factories.
Caveats
Every time you change your configuration, ensure to clear the TYPO3 core caches.
ToDo
- More documentation to get started and define all options available
- More Tests
- More flexibility with the routing parameters
- Proper error handling
License
As TYPO3 Core, this extension is licensed under GPL2 or later. See the LICENSE file for more details.
Authors & Maintenance
This extension was initially created for a customer project by Benni Mack for b13, Stuttgart.
Find more TYPO3 extensions we have developed that help us deliver value in client projects. As part of the way we work, we focus on testing and best practices to ensure long-term performance, reliability, and results in all our code.
All versions of slimphp-bridge with dependencies
typo3/cms-frontend Version ^10.4 || ^11.5 || ^12.4
slim/slim Version ^4.1
sapphirecat/slim4-http-interop-adapter Version ^1.0