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

Nested tags in Mustache.php

I am using Mustache for php to render my webpages. I have been playing around with the code in the dev-branch on github and found some interesting how-to's. I know for example that is it possible to load partials dynamically by defining a helper…
Maarten
  • 635
  • 2
  • 8
  • 22
0
votes
1 answer

Simple way to replace a php switch statement in mustache.php?

I'm working on figuring out how to do common things with Mustache.php. At this point, I'm trying to replace a native php switch statement in the template. Given a "status" flag, e.g. 'A' for Active, and a set of display options like A => Active, I…
Kzqai
  • 22,588
  • 25
  • 105
  • 137
-1
votes
2 answers

What is this kind of data type and how can i call the data to display it individually

So I'm a newbie in php and i wanna ask what kind of data type is this? is it a stirng or a string array? How can i can them lets say if im only want to use the name variable in the string. How can i called them? If its in jsonresponse how do i do it…
Alif Ash
  • 53
  • 1
  • 9
-1
votes
1 answer

Iterate through an array of arrays with Mustache

I have checked all similar questions, no one seem to have answered this. $data = ['data' => array( ['id'=>'1','name'=>'Dupe', 'country' => 'Nigeria'], ['id'=>'3','name'=>'Dipo', 'country' => 'Togo'] )]; $mustache->render('index',…
Oladipo
  • 1,579
  • 3
  • 17
  • 33
1 2 3 4 5 6
7