PHPackages                             phile/template-lex - 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. phile/template-lex

AbandonedArchivedPhile-plugin[Templating &amp; Views](/categories/templating)

phile/template-lex
==================

Use the Lex parser in your templates for PhileCMS

17PHP

Since Mar 24Pushed 8y ago2 watchersCompare

[ Source](https://github.com/PhileCMS/phileTemplateLex)[ Packagist](https://packagist.org/packages/phile/template-lex)[ RSS](/packages/phile-template-lex/feed)WikiDiscussions master Synced 6d ago

READMEChangelog (1)DependenciesVersions (1)Used By (0)

**NOTE**: This repository is not maintained anymore and archived.

phileTemplateLex
================

[](#philetemplatelex)

Use the [Lex](https://github.com/pyrocms/lex) parser in your templates for [PhileCMS](https://github.com/PhileCMS/Phile)

### 1.1 Installation (composer)

[](#11-installation-composer)

```
php composer.phar require phile/template-lex:*

```

### 1.2 Installation (Download)

[](#12-installation-download)

- Install the latest version of [Phile](https://github.com/PhileCMS/Phile)
- Clone this repo into `plugins/phile/templateLex`

### 2. Activation

[](#2-activation)

After you have installed the plugin. You need to add the following line to your `config.php` file:

```
$config['plugins']['phile\\templateLex'] = array('active' => true);

```

#### Install Lex via composer

[](#install-lex-via-composer)

Just add the Lex dependency to your composer.json file:

```
{
  "require": {
    "twig/twig": "1.14.*",
    "michelf/php-markdown": "1.3",
    "pyrocms/lex": "2.2.*" // this is the new line you will need
  }
}
```

Now run your `composer install` command as normal.

Modify your `config.php` file:

```
$config['plugins'] = array(
  // disable the Twig template engine
  'phile\\templateTwig' => array('active' => false),
  // enable the Lex template engine
  'phile\\templateLex' => array('active' => true)
);
```

### Disclaimer

[](#disclaimer)

Due to the nature of the Page model in Phile, and the fact that Lex doesn't like some objects, there are some slightly different properties available to the `pages` array.

- title
- url
- content
- meta

This covers most of the things that the `pages` array covers in Twig.

### Not a drop in replacement for Twig

[](#not-a-drop-in-replacement-for-twig)

If you have not used Lex before, please read the [docs](https://github.com/pyrocms/lex/wiki#basic-usage) because there are a few differences in syntax, and philosophy, over Twig.

I have included an `index.lex` file to show how to recreate the index page from the default theme.

### Why use this over Twig

[](#why-use-this-over-twig)

- Different syntax (all curly braces, no {% %} braces)
- Lighter weight (but this is debatable)
- Much simpler than Twig or Smarty (less functions)

###  Health Score

21

—

LowBetter than 18% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity6

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity41

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 62.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.

### Community

Maintainers

![](https://www.gravatar.com/avatar/e96d91f6220abcbbf2e6bcd12988b11330178e08a33cd663e813257a359b12fc?d=identicon)[NeoBlack](/maintainers/NeoBlack)

---

Top Contributors

[![james2doyle](https://avatars.githubusercontent.com/u/1425304?v=4)](https://github.com/james2doyle "james2doyle (5 commits)")[![NeoBlack](https://avatars.githubusercontent.com/u/1128085?v=4)](https://github.com/NeoBlack "NeoBlack (2 commits)")[![Schlaefer](https://avatars.githubusercontent.com/u/143224?v=4)](https://github.com/Schlaefer "Schlaefer (1 commits)")

### Embed Badge

![Health badge](/badges/phile-template-lex/health.svg)

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

###  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)
