PHPackages                             zfmastery/ze-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. zfmastery/ze-static-pages

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

zfmastery/ze-static-pages
=========================

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

0.0.3(8y ago)620[1 issues](https://github.com/zfmastery/ze-static-pages/issues)BSD-3-ClausePHPPHP ^5.6 || ^7.0

Since Jul 14Pushed 8y ago4 watchersCompare

[ Source](https://github.com/zfmastery/ze-static-pages)[ Packagist](https://packagist.org/packages/zfmastery/ze-static-pages)[ RSS](/packages/zfmastery-ze-static-pages/feed)WikiDiscussions master Synced 4w ago

READMEChangelogDependencies (2)Versions (4)Used By (0)

Zend Expressive Static Pages Module
===================================

[](#zend-expressive-static-pages-module)

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

So many projects will have a number of static pages, pages that require no template variable interpolation or any other form of logic. Given that it should be as simple as possible to just render as many as you need with a minimum of fuss and effort. However, by default, you have to either code this yourself; worse case scenario, you may end up creating loads of code, just to render static content. The intent of the module is to take all that effort away. All you need to do is:

- Create the content itself
- Organise the files as best you see fit in the template directory
- Create routes which link to the respective templates

At this stage, the project is still under heavy development. So there are no further instructions. But, they will follow shortly.

How it Works
------------

[](#how-it-works)

This module aims to make organising and rendering static content as simple as possible. It does so by using the route's name to determine the template to render. In the example below, you can see that it defines a new route, called `/disclosure`. The route uses `StaticPagesAction::class` as the handling middleware and has the name `static.disclosure`.

```
$app->get('/disclosure', \StaticPages\Action\StaticPagesAction::class, 'static.disclosure');
```

The name is important, as it infers the name of the template which `StaticPagesAction` will attempt to render. Specifically, it will attempt to render `disclosure.phtml`. So you can see that the route’s name is the template’s name, minus the `.phtml` extension, and prefixed with `static.`.

At this point, as the module’s quite new, the template directory that is searched, `templates/static-pages`, is fixed, and all templates need to be in the top-level of that directory. What’s more, it’s not been tested with other template rendering engines. However, these are expected to change in an upcoming release.

Getting Started / Installing
----------------------------

[](#getting-started--installing)

To install the module, use Composer by running `composer require zfmastery/ze-static-pages`. The current release doesn't support automatic creation of the required module configuration file, nor of the template directory. That is planned for a future release however.

Given that:

1. Copy the default config file `config/static-pages.global.php` to your Zend Expressive's `config/autoload/` directory.
2. In the root directory, create the directory structure `templates/static-pages/` and in there create your static templates files.
3. Add routes to use your new static templates.

Running the Tests
-----------------

[](#running-the-tests)

To run the unit tests, run `composer test`.

###  Health Score

24

—

LowBetter than 31% of packages

Maintenance17

Infrequent updates — may be unmaintained

Popularity11

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity50

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% 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 ~1 days

Total

3

Last Release

3269d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/d0bcdec86c45b36f8bd2b71de8d7421a273420d1994fa7f080e66d7aba263b88?d=identicon)[zfmastery](/maintainers/zfmastery)

---

Top Contributors

[![settermjd](https://avatars.githubusercontent.com/u/196801?v=4)](https://github.com/settermjd "settermjd (19 commits)")

---

Tags

httppsrmiddlewarepsr-15static contentstatic pages

### Embed Badge

![Health badge](/badges/zfmastery-ze-static-pages/health.svg)

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

###  Alternatives

[psr/http-server-middleware

Common interface for HTTP server-side middleware

18499.3M1.8k](/packages/psr-http-server-middleware)[mezzio/mezzio

PSR-15 Middleware Microframework

3913.8M120](/packages/mezzio-mezzio)[psr/http-server-handler

Common interface for HTTP server-side request handler

179109.8M1.1k](/packages/psr-http-server-handler)[laminas/laminas-stratigility

PSR-7 middleware foundation for building and dispatching middleware pipelines

577.0M95](/packages/laminas-laminas-stratigility)[middlewares/utils

Common utils for PSR-15 middleware packages

503.6M94](/packages/middlewares-utils)[mezzio/mezzio-router

Router subcomponent for Mezzio

265.3M84](/packages/mezzio-mezzio-router)

PHPackages © 2026

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