Mezzio: PSR-7 Middleware in Minutes

Mezzio builds on Stratigility to provide a minimalist PSR-7 middleware framework for PHP, with the following features:

  • Routing. Choose your own router; we support:
  • Aura.Router
  • FastRoute
  • laminas-router
  • DI Containers, via container-interop. All middleware composed in Mezzio may be retrieved from the composed container.
  • Optionally, templating. We support:
  • Plates
  • Twig
  • Laminas's PhpRenderer
  • Error handling. Create templated error pages, or use tools like whoops for debugging purposes.
  • Nested middleware applications. Write an application, and compose it later in another, optionally under a separate subpath.
  • Simplfied installation. Our custom Composer-based installer prompts you for your initial stack choices, giving you exactly the base you want to start from.

Essentially, Mezzio allows you to develop using the tools you prefer, and provides minimal structure and facilities to ease your development.

Should I choose it over Laminas\Mvc? That’s a good question. Here’s what we recommend.

If you’re keen to get started, then keep reading and get started writing your first middleware application today!