PHPackages                             settermjd/laminas-static-pages - 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. [HTTP &amp; Networking](/categories/http)
4. /
5. settermjd/laminas-static-pages

ActiveLibrary[HTTP &amp; Networking](/categories/http)

settermjd/laminas-static-pages
==============================

An easy, almost painless, way to render static pages in Mezzio applications.

1.0.4(9mo ago)65632[3 issues](https://github.com/settermjd/mezzio-static-pages/issues)[2 PRs](https://github.com/settermjd/mezzio-static-pages/pulls)BSD-3-ClausePHPPHP ~8.2.0 || ~8.3.0 || ~8.4.0CI failing

Since Sep 18Pushed 9mo ago3 watchersCompare

[ Source](https://github.com/settermjd/mezzio-static-pages)[ Packagist](https://packagist.org/packages/settermjd/laminas-static-pages)[ Fund](https://funding.communitybridge.org/projects/laminas-project)[ RSS](/packages/settermjd-laminas-static-pages/feed)WikiDiscussions main Synced 3d ago

READMEChangelogDependencies (15)Versions (19)Used By (0)

Laminas Static Pages Module
===========================

[](#laminas-static-pages-module)

[![testing workflow](https://github.com/settermjd/laminas-static-pages/actions/workflows/continuous-integration.yml/badge.svg)](https://github.com/settermjd/laminas-static-pages/actions/workflows/continuous-integration.yml/badge.svg)

An, almost, painless way to render static pages in [Mezzio](https://docs.mezzio.dev/mezzio/) applications.

**Note:** This module **does not** support laminas-mvc applications.

The intent of this package is to avoid the necessity to create handlers and handler factories just to render static content. It was motivated by various projects that I've worked on, where that seemed to be the case, at least at the time. That approach never made sense to me, so that's that motivated me to scratch my own itch.

Getting Started
---------------

[](#getting-started)

To install the package, run `composer require settermjd/laminas-static-pages`.

If you want to automate the enabling of the module when running `composer require/install/update`, then your project needs to use [laminas/laminas-component-installer](https://github.com/laminas/laminas-component-installer). If it does, when the package is installed you'll be asked if you want to enable its ConfigProvider. Answer with `Y` and the package will be ready to use.

If you don't use `laminas-component-installer`, or for some reason or other can't, then ensure that `\StaticPages\ConfigProvider::class,` is in the `ConfigAggregator` list in `config/config.php`, as in the example below.

```
$aggregator = new ConfigAggregator([
    \StaticPages\ConfigProvider::class,
]);
```

With the package installed, you now need to do two further steps:

1. Configure the template path
2. Create routes
3. Create template files

### Configure The Template Path

[](#configure-the-template-path)

To configure the template path, ensure that in your template paths list, there's one with the key `static-pages`, as in the example below.

```
public function getTemplates() : array
{
    return [
        'paths' => [
            'static-pages' => [__DIR__ . '/../templates/static-pages'],
        ],
    ];
}
```

### Create Routes

[](#create-routes)

To create a route for a static page, in your routing table, add one or more named routes where:

1. The route’s handler is `StaticPagesHandler::class`
2. The name follows the convention: `static.`.

Let's assume that we are adding a route for a privacy page and that the template file which will be rendered is `privacy.phtml`. In that case we'd add the following to `config/routes.php`:

```
$app->get('/privacy', StaticPagesHandler::class, 'static.privacy');
```

### Create Template Files

[](#create-template-files)

The file can contain whatever you like, it doesn't matter.

### That’s It

[](#thats-it)

All being well, this should be all that you need to rapidly serve static content files in your [Mezzio](https://docs.mezzio.dev/mezzio/) applications.

Support
-------

[](#support)

- [Issues](https://github.com/settermjd/laminas-static-pages/issues)

###  Health Score

45

—

FairBetter than 92% of packages

Maintenance47

Moderate activity, may be stable

Popularity21

Limited adoption so far

Community13

Small or concentrated contributor base

Maturity84

Battle-tested with a long release history

 Bus Factor1

Top contributor holds 91.2% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~195 days

Recently: every ~213 days

Total

12

Last Release

280d ago

Major Versions

0.0.7 → 1.0.02023-04-05

PHP version history (7 changes)0.0.1PHP ^7.1

0.0.4PHP ^7.3

0.0.5PHP ^7.4

0.0.7PHP &gt;=7.4

1.0.0PHP ^7.4 || ~8.0.0 || ~8.1.0 || ~8.2.0

1.0.2PHP ~8.1.0 || ~8.2.0 || ~8.3.0 || ~8.4.0

1.0.4PHP ~8.2.0 || ~8.3.0 || ~8.4.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/1d4c6c662daf6b4a9742c59d0a72c069633a9772c831ecc1de7a2926ee4d8d95?d=identicon)[settermjd](/maintainers/settermjd)

---

Top Contributors

[![settermjd](https://avatars.githubusercontent.com/u/196801?v=4)](https://github.com/settermjd "settermjd (62 commits)")[![froschdesign](https://avatars.githubusercontent.com/u/103362?v=4)](https://github.com/froschdesign "froschdesign (5 commits)")[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (1 commits)")

---

Tags

htmllaminasmezziophp73psr-15httppsrmiddlewarepsr-15static contentstatic pages

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan, Psalm

Code StylePHP\_CodeSniffer

Type Coverage Yes

### Embed Badge

![Health badge](/badges/settermjd-laminas-static-pages/health.svg)

```
[![Health](https://phpackages.com/badges/settermjd-laminas-static-pages/health.svg)](https://phpackages.com/packages/settermjd-laminas-static-pages)
```

###  Alternatives

[mezzio/mezzio

PSR-15 Middleware Microframework

3883.6M97](/packages/mezzio-mezzio)[psr/http-server-middleware

Common interface for HTTP server-side middleware

18091.2M1.5k](/packages/psr-http-server-middleware)[mezzio/mezzio-skeleton

Laminas mezzio skeleton. Begin developing PSR-15 middleware applications in seconds!

12726.2k](/packages/mezzio-mezzio-skeleton)[mezzio/mezzio-tooling

Migration and development tooling for Mezzio

191.1M21](/packages/mezzio-mezzio-tooling)[mezzio/mezzio-fastroute

FastRoute integration for Mezzio

162.7M52](/packages/mezzio-mezzio-fastroute)[mezzio/mezzio-helpers

Helper/Utility classes for Mezzio

134.3M67](/packages/mezzio-mezzio-helpers)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
