PHPackages                             bnf/slim-typo3 - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Framework](/categories/framework)
4. /
5. bnf/slim-typo3

ActiveTypo3-cms-extension[Framework](/categories/framework)

bnf/slim-typo3
==============

Slim Framework integration for TYPO3

0.5.0(6y ago)63.9k1[2 issues](https://github.com/bnf/slim-typo3/issues)GPL-2.0+PHP

Since Aug 15Pushed 5y ago1 watchersCompare

[ Source](https://github.com/bnf/slim-typo3)[ Packagist](https://packagist.org/packages/bnf/slim-typo3)[ RSS](/packages/bnf-slim-typo3/feed)WikiDiscussions master Synced yesterday

READMEChangelogDependencies (10)Versions (20)Used By (0)

Slim Framework integration for TYPO3
====================================

[](#slim-framework-integration-for-typo3)

[![Build Status](https://camo.githubusercontent.com/1de65921fc80fefe3cfe6dbd1486d13315e830d02fd74cf510b3325d48a9653e/68747470733a2f2f6170692e7472617669732d63692e6f72672f626e662f736c696d2d7479706f332e706e673f6272616e63683d6d6173746572)](https://travis-ci.org/bnf/slim-typo3)[![Coverage Status](https://camo.githubusercontent.com/48345244832f26cedcc71cf74520edf62119e0573189e6ca28e4dc4437747275/68747470733a2f2f636f766572616c6c732e696f2f7265706f732f6769746875622f626e662f736c696d2d7479706f332f62616467652e737667)](https://coveralls.io/github/bnf/slim-typo3)

Introduction
------------

[](#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
-----

[](#usage)

```
$ composer require bnf/slim-typo3:~0.5.0
```

### Quick Example

[](#quick-example)

Register the app definition in ext\_localconf.php (or AdditionalConfiguration.php):

```
\TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance(\Bnf\SlimTypo3\AppRegistry::class)
    ->push(function ($app) {
        $app->get('/hello/{name}', function ($request, $response) {
            $response->getBody()->write('Hello ' . htmlspecialchars($request->getAttribute('name')));
            return $response;
        });
    });
```

That's all and now your route controller should be executed when requesting `/hello/world`.

### Full Example

[](#full-example)

- TODO: Configuration/Services.yaml – tag based registration

ext\_localconf.php:

```
\TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance(\Bnf\SlimTypo3\AppRegistry::class)
    ->push(\Your\Namespace\TestApp::class);
```

TestApp.php

```
