lvincesl/html_template

This package is abandoned and no longer maintained. The author suggests using the lvinceslas/htmltemplate package instead.

A simple template engine for PHP

Maintainers

Package info

github.com/lvinceslas/htmltemplate

pkg:composer/lvincesl/html_template

Statistics

Installs: 88

Dependents: 0

Suggesters: 0

Stars: 0

Open Issues: 0

2.0.2 2026-04-21 05:26 UTC

This package is auto-updated.

Last update: 2026-04-21 05:27:51 UTC


README

Packagist Version PHP Version License

A simple template engine for PHP.

Installation

composer require lvinceslas/htmltemplate

Using Docker (without Composer installed locally)

docker run --rm -it \
  -v "$(pwd):/app" \
  -w /app \
  composer require lvinceslas/htmltemplate

Usage

Create an HTML template file with placeholders, for example:

Hello <b>{%NAME%}</b>, you have successfully installed <em>lvinceslas/htmltemplate</em>!

Then use it in PHP:

<?php

require __DIR__ . '/vendor/autoload.php';

use Lvinceslas\Html\HtmlTemplate;

$template = new HtmlTemplate(__DIR__ . '/path/to/template.html');
$template->set('NAME', 'John Doe');

// You can echo the object directly
echo $template;

// Or explicitly call show()
// $template->show();

Running the test suite

Unit tests use PHPUnit 9.6 (dev dependency). From a clone of this repository, install dependencies then run the suite:

composer install
./vendor/bin/phpunit

Configuration is read from phpunit.xml.dist at the project root.

Using Docker (without Composer installed locally)

docker run --rm -it \
  -v "$(pwd):/app" \
  -w /app \
  composer:latest \
  sh -c "composer install --no-interaction && ./vendor/bin/phpunit"