Questions tagged [mustache.php]

A Mustache (logic-less templating system for HTML) implementation in PHP.

mustache.php is an implementation of in PHP. It requires at least PHP 5.2.x.

You can find more information about Mustache on the official website.

Installation

It can be easily installed using :

{
    "require": {
        "mustache/mustache": "2.0.*"
    }
}

An example

<?php
$m = new Mustache_Engine;
echo $m->render('Hello {{planet}}', array('planet' => 'World!'));
// will print: "Hello World!"

Links

94 questions
0
votes
1 answer

With Mustache PHP, loading partials but not parsing tags

I have a Mustache template which includes some partials. I want to load the partial into a string in PHP, with the contents of the partials included in the string. But I don't want the template to be parsed. eg, if I have this Mustache template,…
Phil Gyford
  • 13,432
  • 14
  • 81
  • 143
0
votes
1 answer

Mustache - How to build a Navigation/Link

I'm sorry for this stupid question but i don't get it! I want to build a simple Website front-end like this Example with Mustache: http://detector.dmolsen.com/demo/mustache/ If I have a Website with just one Page - everything is fine: I create my…
0
votes
1 answer

Iterating through a double array in Mustache

I have a double array that I'm passing into my Mustache file and the first two levels are indexed by number. The variable name is {{groups}} so I can iterate through the outer part with {{#groups}}{{/groups}} but within each group is an array of…
Jarryd Goodman
  • 477
  • 3
  • 9
  • 19
0
votes
0 answers

Mustache PHP - notation for an object array

I'm using the Mustache PHP template engine to render a table with details from a wordpress WP_User_Query. My SQL function is this function getLinkedRunners(){ $usersByCompanyQuery = new WP_User_Query( array( …
emeraldjava
  • 10,894
  • 26
  • 97
  • 170
0
votes
1 answer

How to pass data from different sources using mustache.php and mustache partials?

I'm using mustache.php. Suppose I have an HTML structure like the following (just an example to let you understand my problem) in my mustache template:
0
votes
1 answer

How to get template source in php mustache engine

I am trying to get a raw template that is already loaded by Mustache_Engine. On creation of the mustache object Filesystem_Loader instance is set up and pointing to the default directory. $mustache = new Mustache_Engine( array( 'loader' => new…
Danijel
  • 12,408
  • 5
  • 38
  • 54
0
votes
1 answer

Mustache template with label

If I have the following array array ( 'people' => array( [0] => array('name'=>'name1'), [1] => array('name'=>'name2', 'last' => true) ) ); and I want to output it using a Mustache template so that the final html looks like…
Oskar Persson
  • 6,605
  • 15
  • 63
  • 124
0
votes
1 answer

Mustache partial notation in Eclipse / Zend Studio 10 throws invalid character warning

I'm running Zend Studio 10 with code using mustache templating. Mustache notation for including a partial is (from https://github.com/bobthecow/mustache.php/wiki/Mustache-Tags#partials): {{> my/partial}} This triggers a syntax warning (a little…
Ray
  • 40,256
  • 21
  • 101
  • 138
0
votes
1 answer

Reuse mustache.php in mustache.js

I recently started to use Mustache and I'm in a position where I need to reuse PHP templates also in JS. Although I compiled templates into JS, sometimes is more convenient to just embed templates like this