PHPackages                             mustache/silex-provider - 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. mustache/silex-provider

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

mustache/silex-provider
=======================

A Mustache service provider for Silex.

v2.0.0(9y ago)1462.4k↓37.1%41MITPHPPHP &gt;=5.3.3

Since Jan 21Pushed 8y ago3 watchersCompare

[ Source](https://github.com/bobthecow/mustache-silex-provider)[ Packagist](https://packagist.org/packages/mustache/silex-provider)[ Docs](https://github.com/bobthecow/mustache-silex-provider)[ RSS](/packages/mustache-silex-provider/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependencies (2)Versions (5)Used By (1)

MustacheServiceProvider
=======================

[](#mustacheserviceprovider)

`MustacheServiceProvider` provides [Mustache](http://github.com/bobthecow/mustache.php) integration for the [Silex](http://silex.sensiolabs.org) application micro-framework.

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

[](#installation)

Add `mustache/silex-provider` to your project's `composer.json`:

```
{
    "require": {
        "mustache/silex-provider": "~2.0"
    }
}
```

And install:

```
php composer.phar install

```

Configuration
-------------

[](#configuration)

- `mustache.path` (optional): Path to the directory containing Mustache template files.
- `mustache.partials_path` (optional): Path to the directory containing Mustache partial template files. If none is specified, this will default to `mustache.path`.
- `mustache.partials` (optional): An associative array of template names to template contents. Use this if you want to define partials inline.
- `mustache.helpers` (optional): An associative array of Mustache helpers. See [the Mustache.php helpers documentation](https://github.com/bobthecow/mustache.php/wiki#helpers) for more information.
- `mustache.options` (optional): An associative array of Mustache options. See [the Mustache.php documentation](https://github.com/bobthecow/mustache.php/wiki) for more information.

Services
--------

[](#services)

- `mustache.loader` (optional): A Mustache template loader instance. This loader will use the `mustache.path` option you provided. You can also replace the loader with something awesome of your own.
- `mustache.partials_loader` (optional): The Mustache template loader used to load partials. By default, this will load templates from either your the `mustache.partials_path` or `mustache.partials` configuration options. You can also replace the partials loader with another loader of your choice.

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

[](#registering)

```
