PHPackages                             bruensicke/li3\_mustache - 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. bruensicke/li3\_mustache

ActiveLithium-library[Templating &amp; Views](/categories/templating)

bruensicke/li3\_mustache
========================

Lithium library for rendering mustache templates

2.x-dev(13y ago)52841BSD-3-ClausePHPPHP &gt;=5.3

Since Jun 7Pushed 12y ago1 watchersCompare

[ Source](https://github.com/bruensicke/li3_mustache)[ Packagist](https://packagist.org/packages/bruensicke/li3_mustache)[ Docs](https://github.com/bruensicke/li3_mustache/blob/master/README.md)[ RSS](/packages/bruensicke-li3-mustache/feed)WikiDiscussions master Synced 3w ago

READMEChangelogDependencies (1)Versions (4)Used By (1)

li3\_mustache
=============

[](#li3_mustache)

Lithium library for parsing mustache views, uses [PHP Mustache](https://github.com/bobthecow/mustache.php).

Mustache Spec version: `1.1.2`PHP Mustache version: `1.0.0`

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

[](#installation)

Add a submodule to your li3 libraries:

```
git submodule add git@github.com:bruensicke/li3_mustache.git libraries/li3_mustache

```

and activate it in you app (config/bootstrap/libraries.php), of course:

```
Libraries::add('li3_mustache');

```

Usage
-----

[](#usage)

Within your views, you can easily use mustache elements with a helpful mustache helper:

```

```

The mustache template will then be pulled from `{:library}/views/mustache/posts/detail.html.php`

Any model, that is passed in (or a collection of models) will be converted to array-data at the moment, to allow for easy usage. I will work on a model-callback solution, which allows for template functions to be called.

If you want to provide the mustache template for js-usage, this can be easily done like that:

```

```

This will render the following javascript block (including the template):

```
 { mustache template here }

```

You can easily use this template with `tpl_` followed by `Inflector::slugified` template name (where - will become \_).

additional usage
----------------

[](#additional-usage)

Instead of using only mustache for the view in general, i prefer to use mustache templates for all kind of data representation within the view, whereas i leave the view itself as default html/php mix. But this library comes with a mustache View class as well, to use mustache views completely.

Todos
-----

[](#todos)

The following points is my roadmap. If you need any of this features sooner than later, please let me know.

- \[✓\] Provide useful helper
- \[✓\] allow for easy using of an element as mustache template
- \[✓\] mustache template folder to be at views/mustache
- \[✓\] allow for mustache templates to live within libraries
- \[✓\] allow subtemplates to be rendered, no registration required
- provide additional scope that carries li3-relevant information (i.e. request, session, etc)
- allow callbacks to model methods on collection data

Credits
-------

[](#credits)

- [lithium](http://www.lithify.me)
- [Nate Abele](https://github.com/nateabele/li3_mustache)
- [bobthecow](https://github.com/bobthecow/mustache.php)

Please report any bug, here: [https://github.com/bruensicke/li3\_mustache/issues](https://github.com/bruensicke/li3_mustache/issues)

###  Health Score

25

—

LowBetter than 36% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity14

Limited adoption so far

Community16

Small or concentrated contributor base

Maturity46

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 86.1% 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

Unknown

Total

1

Last Release

4756d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/30408?v=4)[Dirk Brünsicke](/maintainers/d1rk)[@d1rk](https://github.com/d1rk)

---

Top Contributors

[![d1rk](https://avatars.githubusercontent.com/u/30408?v=4)](https://github.com/d1rk "d1rk (31 commits)")[![nateabele](https://avatars.githubusercontent.com/u/18288?v=4)](https://github.com/nateabele "nateabele (3 commits)")[![aaronshaf](https://avatars.githubusercontent.com/u/122654?v=4)](https://github.com/aaronshaf "aaronshaf (1 commits)")[![seguer](https://avatars.githubusercontent.com/u/115344?v=4)](https://github.com/seguer "seguer (1 commits)")

---

Tags

lithiumtemplatemustacheli3

### Embed Badge

![Health badge](/badges/bruensicke-li3-mustache/health.svg)

```
[![Health](https://phpackages.com/badges/bruensicke-li3-mustache/health.svg)](https://phpackages.com/packages/bruensicke-li3-mustache)
```

###  Alternatives

[zordius/lightncandy

An extremely fast PHP implementation of handlebars ( http://handlebarsjs.com/ ) and mustache ( http://mustache.github.io/ ).

60910.9M51](/packages/zordius-lightncandy)[helsingborg-stad/municipio

A bootstrap theme for creating municipality sites.

4028.3k10](/packages/helsingborg-stad-municipio)[pressbooks/pressbooks

Pressbooks is an open source book publishing tool built on a WordPress multisite platform. Pressbooks outputs books in multiple formats, including PDF, EPUB, web, and a variety of XML flavours, using a theming/templating system, driven by CSS.

45344.0k1](/packages/pressbooks-pressbooks)[devtheorem/php-handlebars

A blazing fast, spec-compliant PHP implementation of Handlebars.

4039.8k5](/packages/devtheorem-php-handlebars)[wrklst/docxmustache

docx template manipulation class, based on mustache templating language

578.3k](/packages/wrklst-docxmustache)[pressbooks/pressbooks-book

This theme is named after Canadian media theorist Marshall McLuhan, who coined the phrase “the medium is the message.” It is designed for academic writing and is also suitable for fiction. Headings are set in Cormorant Garamond, and body type is set in Lora.

206.7k](/packages/pressbooks-pressbooks-book)

PHPackages © 2026

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