2017 © Pedro Peláez
 

library mustache-js-compiler

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

image

chh/mustache-js-compiler

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

  • Tuesday, January 21, 2014
  • by chh
  • Repository
  • 1 Watchers
  • 0 Stars
  • 11 Installations
  • PHP
  • 1 Dependents
  • 1 Suggesters
  • 0 Forks
  • 0 Open issues
  • 2 Versions
  • 38 % Grown

The README.md

MustacheJsCompiler

Compiles server-side Mustache templates to self-sufficient client-side JS functions. Uses the excellent PhlyMustache., (*1)

Install

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

Usage

The compiler needs an instance of Phly\Mustache\Mustache to function., (*2)

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)., (*3)

tokenize()`. It
looks up the template name in the template path, or uses the passed Mustache code. The `compile`
method returns a self-sufficient JavaScript function which executes the template.

The template looks like this:

```mustache
{{! user/show.mustache }}
Hi {{name}}!
```

We can render the template using this code:

```php

Unimplemented Mustache Features

  • Filters

The Versions

21/01 2014

dev-master

9999999-dev

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

  Sources   Download

MIT

The Requires

 

The Development Requires

js mustache

08/01 2014

v1.0.0

1.0.0.0

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

  Sources   Download

MIT

The Requires

 

The Development Requires

js mustache