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(12y 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 1mo 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 37% 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

4710d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/28982e1ca3f1117ca2e08514a4b684ad5d099809415e3f41b01c8777390a02fe?d=identicon)[d1rk](/maintainers/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.5M45](/packages/zordius-lightncandy)[wrklst/docxmustache

docx template manipulation class, based on mustache templating language

578.1k](/packages/wrklst-docxmustache)[devtheorem/php-handlebars

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

1924.8k2](/packages/devtheorem-php-handlebars)

PHPackages © 2026

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