PHPackages                             jstormes/html-gateway - 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. [Utility &amp; Helpers](/categories/utility)
4. /
5. jstormes/html-gateway

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

jstormes/html-gateway
=====================

Html Gateway support library

0.0.5(8y ago)036GPL-2.0-or-laterPHPPHP &gt;=7.0.0

Since Jan 8Pushed 8y ago1 watchersCompare

[ Source](https://github.com/jstormes/HtmlGateway)[ Packagist](https://packagist.org/packages/jstormes/html-gateway)[ RSS](/packages/jstormes-html-gateway/feed)WikiDiscussions master Synced 3d ago

READMEChangelogDependencies (6)Versions (6)Used By (0)

HtmlGateway
===========

[](#htmlgateway)

A simple Html Gateway library.

Usage
-----

[](#usage)

PHP is itself a template engine. Rather than reinvent the wheel, I used PHP itself as the template language and wrapped it in design patterns I liked. This package is my favorite design pattern packaged in a nice composer format.

There are three core concepts in this pattern, templates, helpers, and post back processing.

A template is nothing more than an arbitrary text file wrapped in a PHP class. This lets us use PHP interspersed inside the text. Templates can be included inside templates allowing the text to be built in blocks. If this sounds familiar, it is. This is basically what PHP does. As this template is inside a PHP object it has it’s "scope" set to `$this->`. It would be very bad practice to use anything outside the scope directly in a template.

Command Line Docker Quick Start:
--------------------------------

[](#command-line-docker-quick-start)

- Make sure you have Docker and Docker-Compose installed on your workstation.
    -
- Run composer install:
    - BASH (Linux/OS X) `docker run --rm -it -v $(pwd):/app composer install`
    - PowerShell (Windows) `docker run --rm -it -v ${pwd}:/app composer install`
    - CMD (Old Windows) `docker run --rm -it -v %cd%:/app composer install`
- Run PhpUnit:
    - BASH (Linux/OS X) `docker run --rm -it -v $(pwd):/app jstormes/phpunit -c phpunit.xml.dist`
    - PowerShell (Windows) `docker run --rm -it -v ${pwd}:/app jstormes/phpunit -c phpunit.xml.dist`
    - CMD (Old Windows) `docker run --rm -it -v %cd%:/app jstormes/phpunit -c phpunit.xml.dist`

### Example of instantiating a template:

[](#example-of-instantiating-a-template)

### Example of including a template inside a template:

[](#example-of-including-a-template-inside-a-template)

### Example using for formatting email message:

[](#example-using-for-formatting-email-message)

A helper is a class that contains logic that you want to use over and over. Such logic might include translating between languages or displaying dates and currencies in a local format.

### Example of a translate helper:

[](#example-of-a-translate-helper)

### Example of a date helper:

[](#example-of-a-date-helper)

### Demo video at:

[](#demo-video-at)

### Blog Post at:

[](#blog-post-at)

Unit testing
------------

[](#unit-testing)

### To build the unit testing environment run:

[](#to-build-the-unit-testing-environment-run)

`docker-composer run build`

### To run the unit tests at the command line run:

[](#to-run-the-unit-tests-at-the-command-line-run)

`docker-compose run phpunit`

### Unit testing with PhpStorm:

[](#unit-testing-with-phpstorm)

### Video of Unit Testing:

[](#video-of-unit-testing)

### GitHub Page:

[](#github-page)

### Packagist Page:

[](#packagist-page)

###  Health Score

24

—

LowBetter than 32% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity7

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity52

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 ~10 days

Total

5

Last Release

3006d ago

### Community

Maintainers

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

---

Top Contributors

[![jstormes](https://avatars.githubusercontent.com/u/2112702?v=4)](https://github.com/jstormes "jstormes (11 commits)")

###  Code Quality

TestsPHPUnit

Code StylePHP\_CodeSniffer

### Embed Badge

![Health badge](/badges/jstormes-html-gateway/health.svg)

```
[![Health](https://phpackages.com/badges/jstormes-html-gateway/health.svg)](https://phpackages.com/packages/jstormes-html-gateway)
```

###  Alternatives

[zf-commons/zfc-base

A set of genetic (abstract) classes which are commonly used across multiple modules.

1441.1M25](/packages/zf-commons-zfc-base)

PHPackages © 2026

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