Template subcomponent for Mezzio

2.3.0 2021-10-11 12:45 UTC

This package is auto-updated.

Last update: 2021-10-11 12:50:30 UTC


Build Status

Template subcomponent for Mezzio.

This package provides the following classes, interfaces, and traits:

  • TemplateRendererInterface, a generic interface for providing template rendering capabilities.
  • TemplatePath, a value object describing a (optionally) namespaced path in which templates reside; the TemplateRendererInterface returns these.
  • ArrayParametersTrait provides helper methods you can mix in to implementations for normalizing template parameters to an array.
  • DefaultParamsTrait provides helper methods you can mix in to implementations for aggregating default parameters as well as merging global, template-specific, and provided parameters when rendering.


Typically, you will install this when installing Mezzio. However, it can be used standalone to provide a generic way to provide templating to your application. To do this, use:

$ composer require mezzio/mezzio-template

We currently support and provide the following routing integrations:

  • Plates: composer require mezzio/mezzio-platesrenderer
  • Twig: composer require mezzio/mezzio-twigrenderer
  • Laminas PhpRenderer: composer require mezzio/mezzio-laminasviewrenderer


Mezzio provides template documentation.