PHPackages                             nepada/template-factory - 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. nepada/template-factory

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

nepada/template-factory
=======================

Latte powered template factory on steroids.

v2.8.1(4y ago)423.3k—0%BSD-3-ClausePHPPHP &gt;=7.4.0 &lt;8.2

Since Feb 23Pushed 4y ago1 watchersCompare

[ Source](https://github.com/nepada/template-factory)[ Packagist](https://packagist.org/packages/nepada/template-factory)[ RSS](/packages/nepada-template-factory/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (10)Dependencies (16)Versions (21)Used By (0)

Template Factory
================

[](#template-factory)

[![Build Status](https://github.com/nepada/template-factory/workflows/CI/badge.svg)](https://github.com/nepada/template-factory/actions?query=workflow%3ACI+branch%3Amaster)[![Coverage Status](https://camo.githubusercontent.com/c5614d75b97e5d166e5ee30c08cbb5e621759c9eba472977262337a93e78ce3d/68747470733a2f2f636f766572616c6c732e696f2f7265706f732f6769746875622f6e65706164612f74656d706c6174652d666163746f72792f62616467652e7376673f6272616e63683d6d6173746572)](https://coveralls.io/github/nepada/template-factory?branch=master)[![Downloads this Month](https://camo.githubusercontent.com/5115b368ef5058bd797ec181964fa146dc3204283015d0633882a989565adf10/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f646d2f6e65706164612f74656d706c6174652d666163746f72792e737667)](https://packagist.org/packages/nepada/template-factory)[![Latest stable](https://camo.githubusercontent.com/fd016d2b7271d705d23809a792d4271f44eb923c7778f411faae0353b70d7ca3/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6e65706164612f74656d706c6174652d666163746f72792e737667)](https://packagist.org/packages/nepada/template-factory)

Package abandoned
-----------------

[](#package-abandoned)

**This package is considered obsolete and abandoned.** Nette and Latte has evolved a lot since the inception of this package. The functionality of this package can now be replaced by a combination of Latte 3 extensions and `TemplateFactory::$onCreate` callback.

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

[](#installation)

Via Composer:

```
$ composer require nepada/template-factory
```

Register the extension in `config.neon`:

```
extensions:
    templateFactory: Nepada\Bridges\TemplateFactoryDI\TemplateFactoryExtension
```

Usage
-----

[](#usage)

### Translator autowiring

[](#translator-autowiring)

Who would want to call `setTranslator()` manually on every template? With this template factory all you need is to define `ITranslator` service in your configuration and it gets automatically injected into created templates.

### Custom Latte filters

[](#custom-latte-filters)

Do you need custom Latte filters in templates? Their definition is pretty straightforward:

```
templateFactory:
    filters:
        doStuff: [@someService, doStuff]
```

### Template parameters

[](#template-parameters)

This is the ultimate answer to the question "How do I get parameter / service from DI container into template?"

```
templateFactory:
    parameters:
        foo: bar
        service: @anotherService
        containerParam: %param%
```

### Template providers

[](#template-providers)

Similarly to parameters, you can also set latte providers:

```
templateFactory:
    providers:
        foo: bar
        service: @anotherService
        containerParam: %param%
```

### Custom template functions

[](#custom-template-functions)

Similarly to filters, you can also define callbacks for your custom template functions:

```
templateFactory:
    functions:
        doStuff: [@someService, doStuff]
```

### Configuration from another `CompilerExtension`

[](#configuration-from-another-compilerextension)

Some extensions may need to install a Latte filter, or inject a parameter / service into template. This can be done in `beforeCompile()` phase by customizing setup of `TemplateConfigurator`.

```
$templateConfigurator = $containerBuilder->getByType(Nepada\TemplateFactory\TemplateConfigurator::class);
$containerBuilder->getDefinition($templateConfigurator)
    ->addSetup('addFilter', ['filterName', $callback])
    ->addSetup('addFunction', ['functionName', $callback])
    ->addSetup('addProvider', ['provider', $value])
    ->addSetup('addParameter', ['parameter', $value])
    ->addSetup('addParameter', ['parameter', '@someService']);
```

###  Health Score

41

—

FairBetter than 89% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity30

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity85

Battle-tested with a long release history

 Bus Factor1

Top contributor holds 72.5% 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 ~120 days

Recently: every ~216 days

Total

20

Last Release

1460d ago

Major Versions

v1.2.1 → v2.0.02018-06-03

PHP version history (5 changes)v1.0.0PHP &gt;= 5.6.0

v1.2.0PHP &gt;=7.1.0

v2.4.0PHP &gt;=7.2.0

v2.5.0PHP &gt;=7.4.0

v2.8.1PHP &gt;=7.4.0 &lt;8.2

### Community

Maintainers

![](https://www.gravatar.com/avatar/5b4780fe328102c4572737db639653c29d3081d1d3e051467f00d7f09a776399?d=identicon)[xificurk](/maintainers/xificurk)

---

Top Contributors

[![xificurk](https://avatars.githubusercontent.com/u/117465?v=4)](https://github.com/xificurk "xificurk (145 commits)")[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (55 commits)")

---

Tags

nettetemplatelatte

###  Code Quality

Static AnalysisPHPStan

Type Coverage Yes

### Embed Badge

![Health badge](/badges/nepada-template-factory/health.svg)

```
[![Health](https://phpackages.com/badges/nepada-template-factory/health.svg)](https://phpackages.com/packages/nepada-template-factory)
```

###  Alternatives

[latte/latte

☕ Latte: the intuitive and fast template engine for those who want the most secure PHP sites. Introduces context-sensitive escaping.

1.3k15.7M683](/packages/latte-latte)[nepada/form-renderer

Latte template based form renderer for Nette forms with full support for Bootstrap 3, 4 &amp; 5.

11251.0k](/packages/nepada-form-renderer)[contributte/latte

Extra contrib to nette/latte

111.5M2](/packages/contributte-latte)

PHPackages © 2026

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