PHPackages                             sanderdlm/mono - 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. sanderdlm/mono

ActiveLibrary

sanderdlm/mono
==============

tiny framework, big dreams

0.6(2y ago)828MITPHPPHP ^8.2 || ^8.3

Since Nov 21Pushed 2y ago1 watchersCompare

[ Source](https://github.com/sanderdlm/mono)[ Packagist](https://packagist.org/packages/sanderdlm/mono)[ RSS](/packages/sanderdlm-mono/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (7)Dependencies (11)Versions (12)Used By (0)

Mono
====

[](#mono)

Mono is a minimal, modern PHP framework in a single file.

It contains no custom implementations, but rather acts as a wrapper around the following great projects:

1. Routing (using [nikic/FastRoute](https://github.com/nikic/FastRoute))
2. Dependency injection (using [php-di/php-di](https://github.com/PHP-DI/PHP-DI))
3. Middlewares (using [relay/relay](https://github.com/relayphp/Relay.Relay))
4. Templating (using [twigphp/wig](https://github.com/twigphp/Twig))
5. Data-to-object mapping (using [cuyz/valinor](https://github.com/CuyZ/Valinor))

This is the interface of the `Mono` class:

```
interface MonoInterface
{
    // Render a Twig template
    public function render(string $template, array $data): string;

    // Add a middleware to the PSR-15 stack
    public function addMiddleware(MiddlewareInterface|callable $middleware): void;

    // Add a route to the FastRoute router
    public function addRoute(string|array $method, string $path, callable $handler): void;

    // Run the app
    public function run(): void;
}
```

Using just these methods, we have all the tools to build our application:

```
