PHPackages                             xorock/zend-phptal - 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. xorock/zend-phptal

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

xorock/zend-phptal
==================

PHPTAL integration for Zend Framework 3

0.1.1(9y ago)019BSD-3-ClausePHPPHP ^5.5 || ^7.0

Since Aug 19Pushed 9y ago1 watchersCompare

[ Source](https://github.com/xorock/zend-phptal)[ Packagist](https://packagist.org/packages/xorock/zend-phptal)[ RSS](/packages/xorock-zend-phptal/feed)WikiDiscussions master Synced today

READMEChangelog (2)Dependencies (4)Versions (3)Used By (0)

PHPTAL Integration for Zend Framework 3
=======================================

[](#phptal-integration-for-zend-framework-3)

Provides [PHPTAL](http://phptal.org/) integration for [Zend Framework 3](https://github.com/zendframework/zendframework).

Installation
------------

[](#installation)

Install this library using composer:

```
$ composer require xorock/zend-phptal
```

Then add `ZfPhptal` to Your module config under the `modules` key.

Configuration
-------------

[](#configuration)

The following configuration options, specific to PHPTAL, is consumed by Service Factory:

```
return [
    'zfphptal' => [
        'cache_dir' => 'path to cached templates',
        // if enabled, delete all template cache files before processing
        'cache_purge_mode' => boolean,
        // set how long compiled templates and phptal:cache files are kept; in days
        'cache_lifetime' => 30,
        'encoding' => 'set input and ouput encoding; defaults to UTF-8',
        // one of the predefined constants: PHPTAL::HTML5,  PHPTAL::XML, PHPTAL::XHTML
        'output_mode' => PhptalEngine::HTML5,
        // set whitespace compression mode
        'compress_whitespace' => boolean,
        // strip all html comments
        'strip_comments' => boolean,
        // if enabled, forces to reparse templates every time
        'debug' => boolean,
    ],
];
```

Using Zend Framework View Helpers
---------------------------------

[](#using-zend-framework-view-helpers)

PhptalRenderer proxies to HelperPluginManager by `public function plugin($name, array $options = null)` or directly with `__call()`:

```
link
```

You can register own plugins in global / module config using ZF 'view\_helpers' option key. For example, to register `Test` plugin:

**module.config.php**

```
return [
    'view_helpers' => [
        'aliases' => [
            'test' => \My\View\Helper\Test::class,
        ],
        'factories' => [
            \My\View\Helper\Test::class => \Zend\ServiceManager\Factory\InvokableFactory::class
        ],
    ],
];

// inside template
// ${php: this.test()}
```

Examples
--------

[](#examples)

Example .html files for the skeleton application can be found in the [examples](https://github.com/xorock/zend-phptal/tree/master/examples)folder.

Backward compatibility with ZTAL
--------------------------------

[](#backward-compatibility-with-ztal)

For backward compatibility with [ZTAL Project](https://github.com/namesco/ZTal) renderer registers numerous standard variables.

```
$this->engine->set('doctype', $this->plugin('Doctype'));
$this->engine->set('headTitle', $this->plugin('HeadTitle'));
$this->engine->set('headScript', $this->plugin('HeadScript'));
$this->engine->set('headLink', $this->plugin('HeadLink'));
$this->engine->set('headMeta', $this->plugin('HeadMeta'));
$this->engine->set('headStyle', $this->plugin('HeadStyle'));
```

###  Health Score

23

—

LowBetter than 26% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity6

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity49

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

Total

2

Last Release

3593d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/111481?v=4)[xorock](/maintainers/xorock)[@xorock](https://github.com/xorock)

---

Top Contributors

[![xorock](https://avatars.githubusercontent.com/u/111481?v=4)](https://github.com/xorock "xorock (7 commits)")

---

Tags

zfmodulezf3phptal

###  Code Quality

TestsPHPUnit

Code StylePHP\_CodeSniffer

### Embed Badge

![Health badge](/badges/xorock-zend-phptal/health.svg)

```
[![Health](https://phpackages.com/badges/xorock-zend-phptal/health.svg)](https://phpackages.com/packages/xorock-zend-phptal)
```

###  Alternatives

[kokspflanze/zfc-twig

Laminas/Zend Framework Module that provides a Twig rendering strategy and extensions to render actions or trigger events from your templates

14305.3k4](/packages/kokspflanze-zfc-twig)[oxcom/zend-twig

ZendTwig is a module that integrates the Twig template engine with Zend Framework 3.

18112.4k](/packages/oxcom-zend-twig)[phptal/phptal

PHPTAL is a templating engine for PHP5 that implements Zope Page Templates syntax

180436.7k20](/packages/phptal-phptal)[zf-commons/zfc-twig

Zend Framework 2 Module that provides a Twig rendering strategy and extensions to render actions or trigger events from your templates

93578.7k7](/packages/zf-commons-zfc-twig)[namesco/ztal

ZTal makes integrating the PHP templating system PHPTAL into Zend Framework easy.

2119.9k](/packages/namesco-ztal)[zfc-datagrid/zfc-datagrid

Laminas Module that provides a datagrid for different datasources and output formats

1224.2k](/packages/zfc-datagrid-zfc-datagrid)

PHPackages © 2026

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