PHPackages                             stefanobalocco/neartal - 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. [Templating &amp; Views](/categories/templating)
4. /
5. stefanobalocco/neartal

AbandonedArchivedLibrary[Templating &amp; Views](/categories/templating)

stefanobalocco/neartal
======================

PHP HTML5 template engine losely based on TAL specification

04PHP

Since Jan 8Pushed 12y ago1 watchersCompare

[ Source](https://github.com/StefanoBalocco/NearTAL)[ Packagist](https://packagist.org/packages/stefanobalocco/neartal)[ RSS](/packages/stefanobalocco-neartal/feed)WikiDiscussions master Synced yesterday

READMEChangelogDependenciesVersions (1)Used By (0)

NearTAL
=======

[](#neartal)

A php template engine based on TAL, an attribute-based template engine. This version is a fork from my previous project "SmallTAL", and utilize data- attributes to allow the templates to be html5 complaint.

There is at least two other php tal implementation (PHPTAL, for example), but this implementation was written thinking about size and speed; tal templates are converted into php code (without the inner data), allowing to reuse them without the need of future conversion. Each time a template is requested, if the template/metal file/neartal source was modified after the template compilation, the library recompile the template into php code. The template engine uses a personal fork of the ganon html5 parser ( ).

It's licensed under a BSD-like license.

Using
-----

[](#using)

To use NearTAL you need to do:

1. Create a temp directory, a cache directory and a template directory
2. Template directory should have this structure: | Templates +-- TemplateName.metal.html &lt; macros for the template +--| TemplateName +-- PageName.html
3. Use the library in your project, for example:

include( 'NearTAL.php' ); $data\_required\_by\_the\_template = array ( 'variabile' =&gt; 'a value', 'arrayVariable' =&gt; array ( 'some data', 'some other data' ) ); $nearTALpaths = array ( 'temp' =&gt; '/path/to/temp/directory', 'template' =&gt; '/path/to/the/template/directory', 'cache' =&gt; '/path/where/cache/file/will/be/stored' );

$returnValue = NearTAL( "TemplateName", "PageName", $data\_required\_by\_the\_template, $nearTALpaths );

If you want to obtain the template in a variable, you should use ob\_start()/ob\_get\_clean().

You can look the NearTAL.Tests.php (it's a PHPUnit test case) file and/or the tests folder.

Unsupported TAL/TALES features
------------------------------

[](#unsupported-taltales-features)

This is a minimal TAL template engine, optional features isn't supported. Also on-error isn't supported.

Usefull links
-------------

[](#usefull-links)

TAL specification: TALES specification: METAL specification: Owlfish TAL, TALES and METAL reference:

###  Health Score

19

—

LowBetter than 10% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity3

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity41

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.

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/1469044?v=4)[Stefano Balocco](/maintainers/stefanobalocco)[@StefanoBalocco](https://github.com/StefanoBalocco)

---

Top Contributors

[![StefanoBalocco](https://avatars.githubusercontent.com/u/1469044?v=4)](https://github.com/StefanoBalocco "StefanoBalocco (8 commits)")

### Embed Badge

![Health badge](/badges/stefanobalocco-neartal/health.svg)

```
[![Health](https://phpackages.com/badges/stefanobalocco-neartal/health.svg)](https://phpackages.com/packages/stefanobalocco-neartal)
```

###  Alternatives

[mustache/mustache

A Mustache implementation in PHP.

3.3k44.6M291](/packages/mustache-mustache)[roots/acorn

Framework for Roots WordPress projects built with Laravel components.

9682.1M97](/packages/roots-acorn)[whitecube/nova-flexible-content

Flexible Content &amp; Repeater Fields for Laravel Nova.

8053.0M25](/packages/whitecube-nova-flexible-content)[mopa/bootstrap-bundle

Easy integration of twitters bootstrap into symfony2

7042.9M33](/packages/mopa-bootstrap-bundle)[limenius/react-bundle

Client and Server-side react rendering in a Symfony Bundle

3871.2M](/packages/limenius-react-bundle)[nicmart/string-template

StringTemplate is a very simple string template engine for php. I've written it to have a thing like sprintf, but with named and nested substutions.

2101.7M30](/packages/nicmart-string-template)

PHPackages © 2026

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