PHPackages                             chh/mustache-js-compiler - 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. chh/mustache-js-compiler

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

chh/mustache-js-compiler
========================

Compiles server-side Mustache templates to self-sufficient client-side JS functions

v1.0.0(12y ago)028MITPHPPHP &gt;=5.3.8

Since Jan 8Pushed 12y ago1 watchersCompare

[ Source](https://github.com/CHH/MustacheJsCompiler)[ Packagist](https://packagist.org/packages/chh/mustache-js-compiler)[ RSS](/packages/chh-mustache-js-compiler/feed)WikiDiscussions master Synced yesterday

READMEChangelogDependencies (2)Versions (2)Used By (0)

MustacheJsCompiler
==================

[](#mustachejscompiler)

Compiles server-side Mustache templates to self-sufficient client-side JS functions. Uses the excellent [PhlyMustache](http://github.com/phly/phly_mustache).

Install
=======

[](#install)

```
composer require 'chh/mustache-js-compiler':~1.0@dev

```

Usage
=====

[](#usage)

The compiler needs an instance of `Phly\Mustache\Mustache` to function.

If you intend to share templates between the server and the client, than it's recommended to use the same Mustache instance which your application uses so the template paths are setup the same way (for partials to be compiled correctly).

```
