PHPackages                             hashchange/slim-legacy-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. hashchange/slim-legacy-mustache

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

hashchange/slim-legacy-mustache
===============================

Mustache support for Slim 1.x, backward compatible with PHP 5.2

2.0.0(13y ago)130MITPHPPHP &gt;=5.3.0

Since Feb 23Pushed 13y ago1 watchersCompare

[ Source](https://github.com/hashchange/Slim-Legacy-Mustache)[ Packagist](https://packagist.org/packages/hashchange/slim-legacy-mustache)[ Docs](http://github.com/codeguy/Slim-Extras)[ RSS](/packages/hashchange-slim-legacy-mustache/feed)WikiDiscussions master Synced 4w ago

READMEChangelogDependencies (1)Versions (8)Used By (0)

Mustache support for Slim, backward compatible with PHP 5.2
===========================================================

[](#mustache-support-for-slim-backward-compatible-with-php-52)

[Slim](http://www.github.com/codeguy/Slim) is a micro PHP 5 framework that helps you quickly write simple yet powerful RESTful web applications. Its [1.x branch](http://github.com/codeguy/Slim/tree/1.6.7) is backward compatible with PHP 5.2.

This repository contains a custom Mustache view for Slim 1.x, offering full support for [Mustache.php](http://github.com/bobthecow/mustache.php).

Where it differs from the "official" repo
-----------------------------------------

[](#where-it-differs-from-the-official-repo)

Mustache support for Slim is provided by a single class. It is based on the [Mustache view](https://github.com/codeguy/Slim-Extras/blob/develop/Views/Mustache.php) contained in [Slim-Extras](http://github.com/codeguy/Slim-Extras), but is customized in a number of ways.

Functional differences:

- This version of the class is compatible with PHP 5.2 and does not use namespaces.
- The class allows an object to be used as view data, thus enabling the use of [Mustache lambdas](http://mustache.github.com/mustache.5.html) in PHP 5.2. The version in the official repo only supports arrays.

Implementation details:

- The class requires Slim 1.x and won't work with Slim 2.x (use Slim-Extras for that). It extends `Slim_View`, not `\Slim\View`.
- The class is called `View_Mustache`, not `Mustache`. It has been renamed to avoid conflicts in the absence of namespaces.

Otherwise, it is used in the exact same way as the class provided with [Slim-Extras](http://github.com/codeguy/Slim-Extras). See there for usage notes.

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

[](#installation)

Slim-Legacy-Mustache is best installed with Composer and is available from Packagist as "hashchange/slim-legacy-mustache".

The following setup in `composer.json` will install Slim and Mustache for PHP 5.2 in one go:

```
{
    "require": {
        "slim/slim": "1.*",
        "hashchange/slim-legacy-mustache": "*",
        "mustache/mustache": "2.*"
    }
}

```

Version
-------

[](#version)

The current version is based on [Mustache.php @ b12fdd0](https://github.com/codeguy/Slim-Extras/blob/b12fdd069062a0d30d1584aad3aa5bd76c275c5e/Views/Mustache.php) in Slim-Extras 2.0.3-develop, last updated on [19 Jan 2013](https://github.com/codeguy/Slim-Extras/commits/develop/Views/Mustache.php). It was tested with [Slim 1.6.7](http://github.com/codeguy/Slim/tree/1.6.7).

Related
-------

[](#related)

**Slim**

[Primary Slim repo](http://www.github.com/codeguy/Slim)
[Primary Slim-Extras repo](http://github.com/codeguy/Slim-Extras)
[Slim website](http://www.slimframework.com/)

**Mustache**

[Primary Mustache.php repo](http://github.com/bobthecow/mustache.php)
[Mustache.php wiki](http://github.com/bobthecow/mustache.php/wiki)
[Mustache website](http://mustache.github.com/)

Open Source License
-------------------

[](#open-source-license)

The resources in this repository are released under the MIT public license.

###  Health Score

28

—

LowBetter than 52% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity9

Limited adoption so far

Community12

Small or concentrated contributor base

Maturity63

Established project with proven stability

 Bus Factor1

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

Every ~101 days

Total

5

Last Release

4836d ago

Major Versions

1.0.2 → 2.0.02012-09-10

PHP version history (2 changes)1.0.1PHP &gt;=5.2.0

2.0.0PHP &gt;=5.3.0

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/481198?v=4)[hashchange](/maintainers/hashchange)[@hashchange](https://github.com/hashchange)

---

Top Contributors

[![silentworks](https://avatars.githubusercontent.com/u/79497?v=4)](https://github.com/silentworks "silentworks (16 commits)")[![hashchange](https://avatars.githubusercontent.com/u/481198?v=4)](https://github.com/hashchange "hashchange (8 commits)")[![cenan](https://avatars.githubusercontent.com/u/1283501?v=4)](https://github.com/cenan "cenan (2 commits)")[![chenly](https://avatars.githubusercontent.com/u/13716?v=4)](https://github.com/chenly "chenly (1 commits)")[![techdubb](https://avatars.githubusercontent.com/u/181554?v=4)](https://github.com/techdubb "techdubb (1 commits)")

---

Tags

templatingextensions

### Embed Badge

![Health badge](/badges/hashchange-slim-legacy-mustache/health.svg)

```
[![Health](https://phpackages.com/badges/hashchange-slim-legacy-mustache/health.svg)](https://phpackages.com/packages/hashchange-slim-legacy-mustache)
```

###  Alternatives

[twig/twig

Twig, the flexible, fast, and secure template language for PHP

8.4k457.8M6.8k](/packages/twig-twig)[mustache/mustache

A Mustache implementation in PHP.

3.3k46.6M313](/packages/mustache-mustache)[smarty/smarty

Smarty - the compiling PHP template engine

2.4k40.9M448](/packages/smarty-smarty)[laminas/laminas-view

Fast and type safe HTML templating library with a flexible plugin system supporting multistep template composition

7527.7M261](/packages/laminas-laminas-view)[dearon/slim-mustache

Mustache View Parser package for the Slim Framework

144.9k2](/packages/dearon-slim-mustache)[yepsua/smartwig-bundle

The jQuery, jQueryUI (and more) Symfony Bundle

214.0k3](/packages/yepsua-smartwig-bundle)

PHPackages © 2026

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