PHPackages                             liquidbox/silex-plates - 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. liquidbox/silex-plates

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

liquidbox/silex-plates
======================

A Plates template engine service provider for the Silex micro-framework

v2.0.0(8y ago)011.5kMITPHP

Since Dec 2Pushed 8y ago1 watchersCompare

[ Source](https://github.com/liquidbox/silex-plates)[ Packagist](https://packagist.org/packages/liquidbox/silex-plates)[ RSS](/packages/liquidbox-silex-plates/feed)WikiDiscussions master Synced 2mo ago

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

[![GitHub release](https://camo.githubusercontent.com/143d026e8343df46ac73abd357973a101bd0e6559d638a5067634093d1890797/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f72656c656173652f6c6971756964626f782f73696c65782d706c617465732e737667)](https://github.com/liquidbox/silex-plates/releases)[![license](https://camo.githubusercontent.com/f587cca87c8e2d4060e211edee1e64112e01ea74a96e9ba0369a6430752ac638/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6963656e73652f6c6971756964626f782f73696c65782d706c617465732e737667)](LICENSE)[![Build Status](https://camo.githubusercontent.com/bc42da6a2d3207f402fec83f48b0acf43c2550a0484990eeb6e98c8fdd01b281/68747470733a2f2f7472617669732d63692e6f72672f6c6971756964626f782f73696c65782d706c617465732e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/liquidbox/silex-plates)[![Code Coverage](https://camo.githubusercontent.com/beda139aab9091f3d1187887a1c3626cd0dccfcff9f207349d28a6be67aff0fd/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f6c6971756964626f782f73696c65782d706c617465732f6261646765732f636f7665726167652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/liquidbox/silex-plates/?branch=master)[![Scrutinizer Code Quality](https://camo.githubusercontent.com/a6bea6afa79b9022146e0511c2a5745ea5e074c30768f6b98153ac27408e05aa/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f6c6971756964626f782f73696c65782d706c617465732f6261646765732f7175616c6974792d73636f72652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/liquidbox/silex-plates/?branch=master)[![Packagist](https://camo.githubusercontent.com/f30e43d2ec7bd5c2276a0449ba61eab68b46f890dcfebe932f1690ce10b65a77/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6c6971756964626f782f73696c65782d706c617465732e737667)](https://packagist.org/packages/liquidbox/silex-plates)

You are reading the documentation for Silex 2.x. Switch to the documentation for Silex [1.x](../v1.0.0/README.md).

Plates
======

[](#plates)

The *PlatesServiceProvider* provides integration with the [Plates](http://platesphp.com) template engine.

Parameters
----------

[](#parameters)

- **plates.directory** (optional): The default template directory.
- **plates.file\_extension** (optional): The template file extension.
- **plates.folders** (optional): A collection of template folders to add for grouping templates under different namespaces.
- **plates.data** (optional): A collection of data shared with all templates to add.
- **plates.functions** (optional): A collection of template functions to register.
- **plates.extension.asset** (optional): The asset extension directory to load that adds the ability to create "cache busted" asset URLs.

Services
--------

[](#services)

- **plates**: The [`Engine`](http://platesphp.com/engine) instance. The main way of interacting with Plates.
- **plates.engine\_factory**: Factory for `Engine` instances.
- **plates.loader**: The loader for Plates templates which uses the `plates.folders`, `plates.data`, and `plates.functions` options.
- **plates.extension\_loader.asset**: Create new Asset extension instance that adds the ability to create "cache busted" asset URLs.

Registering
-----------

[](#registering)

```
$app->register(new \LiquidBox\Silex\Provider\PlatesServiceProvider(), array(
    'plates.directory' => '/path/to/templates',
    'plates.folders' => array(
        'email' => '/path/to/email/templates',
    ),
));
```

Add Plates as a dependency:

```
composer require liquidbox/silex-plates:^2.0
```

Usage
-----

[](#usage)

```
// Add any additional folders
$app['plates']->addFolder('emails', '/path/to/emails');

// Load asset extension
$app['plates.extension_loader.asset']('/path/to/public');

// Create a new template
$template = $app['plates']->make('emails::welcome');
```

Symfony Components Integration
------------------------------

[](#symfony-components-integration)

The `PlatesServiceProvider` provides additional integration between some Symfony components and Plates. This will provide you with the following additional capabilities.

### Routing Support

[](#routing-support)

If you are using the `UrlGeneratorServiceProvider`, you will have access to the `path()` and `url()` functions. You can find more information in the [Symfony Routing documentation](http://symfony.com/doc/2.8/routing.html).

### Security Support

[](#security-support)

If you are using the `SecurityServiceProvider`, you will have access to the `is_granted()` function in templates. You can find more information in the [Symfony Security documentation](http://symfony.com/doc/2.8/security.html).

Customization
-------------

[](#customization)

You can configure the Plates environment before using it when registering the `plates` service:

```
$app->register(new \LiquidBox\Silex\Provider\PlatesServiceProvider(), array(
    'plates.data' => array(
        'title' => 'Plates - Native PHP Templates',
    ),
    'plates.functions' => array(
        'uppercase' => function ($string) {
            return strtoupper($string);
        },
    ),
));
```

For more information, check out the [official Plates documentation](http://platesphp.com/).

###  Health Score

31

—

LowBetter than 68% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity19

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity64

Established project with proven stability

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

Total

2

Last Release

3081d ago

Major Versions

v1.0.0 → v2.0.02017-12-02

### Community

Maintainers

![](https://www.gravatar.com/avatar/8234ca98aadd933490ff60c15e6ae944e7c25fae5075ba8caa0de2368657f63d?d=identicon)[liquidbox](/maintainers/liquidbox)

---

Top Contributors

[![ExplicitDev](https://avatars.githubusercontent.com/u/17163543?v=4)](https://github.com/ExplicitDev "ExplicitDev (3 commits)")

---

Tags

phpleaguehtmltemplateserviceprovidersilexengineplatesthephpleague

###  Code Quality

TestsPHPUnit

Code StylePHP CS Fixer

### Embed Badge

![Health badge](/badges/liquidbox-silex-plates/health.svg)

```
[![Health](https://phpackages.com/badges/liquidbox-silex-plates/health.svg)](https://phpackages.com/packages/liquidbox-silex-plates)
```

PHPackages © 2026

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