Begin developing PSR-7 middleware applications in minutes!
zend-expressive builds on zend-stratigility to provide a minimalist PSR-7 middleware framework for PHP, with the following features:
- Routing. Choose your own router; we support:
- DI Containers, via container-interop. Middleware matched via routing is retrieved from the composed container.
- Optionally, templating. We support:
We provide two ways to install Expressive, both using Composer: via our [skeleton project and installer](https://github.com/zendframework/zend-expressive-skeleton], or manually.
Using the skeleton + installer
The simplest way to install and get started is using the skeleton project, which includes installer scripts for choosing a router, dependency injection container, and optionally a template renderer and/or error handler. The skeleton also provides configuration for officially supported dependencies.
To use the skeleton, use Composer's
$ composer create-project zendframework/zend-expressive-skeleton <project dir>
This will prompt you through choosing your dependencies, and then create and
install the project in the
<project dir> (omitting the
<project dir> will
create and install in a
Manual Composer installation
You can install Expressive standalone using Composer:
$ composer require zendframework/zend-expressive
However, at this point, Expressive is not usable, as you need to supply minimally:
- a router.
- a dependency injection container.
We currently support and provide the following routing integrations:
composer require zendframework/zend-expressive-aurarouter
composer require zendframework/zend-expressive-fastroute
- ZF2 MVC Router:
composer require zendframework/zend-expressive-zendrouter
We recommend using a dependency injection container, and typehint against container-interop. We can recommend the following implementations:
composer require zendframework/zend-servicemanager
composer require mouf/pimple-interop
composer require aura/di:3.0.*@beta
Additionally, you may optionally want to install a template renderer implementation, and/or an error handling integration. These are covered in the documentation.
$ bookdown doc/bookdown.json $ php -S 0.0.0.0:8080 -t doc/html/ # then browse to http://localhost:8080/
You can install bookdown globally using
composer global require bookdown/bookdown. If you do this, make sure that
$HOME/.composer/vendor/binis on your
Additionally, public-facing, browseable documentation is available at http://zend-expressive.rtfd.org.
Architectural notes are in NOTES.md.
Please see the tests for full information on capabilities.