2017 © Pedro Peláez
 

elgg-plugin mustache

Mustache templating in Elgg

image

hypejunction/mustache

Mustache templating in Elgg

  • Friday, October 2, 2015
  • by hypeJunction
  • Repository
  • 1 Watchers
  • 0 Stars
  • 28 Installations
  • JavaScript
  • 2 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 3 Versions
  • 0 % Grown

The README.md

Mustache templating for Elgg

Elgg 2.0, (*1)

Features

  • Templates can be rendered both client and server side
  • Compatible with Elgg's view system
  • AMD-friendly

Usage

  1. Create a new template as an Elgg view

// /my_plugin/views/default/path/to/template.html

Hello, {{name}}

You can also use PHP views, e.g. template.html.php. This allows you to call other views and do stuff with PHP. If you use this approach, be sure to register the template views in simplecache, so that they are accessible with AMD., (*2)


// /start.php elgg_register_simplecache_view('path/to/template.html.php');

// /my_plugin/views/default/path/to/template.html.php

Hello, {{name}}

= elgg_view('path/to/other/template.html') ?>
  1. Render server-side

echo mustache()->render(elgg_view('mustache/template.html'), array( 'name' => elgg_get_logged_in_user_entity()->name, ));
  1. Render client-side

define(function(require) { var elgg = require('elgg'); var mustache = require('mustache'); var template = require('text!mustache/template.html'); var view = mustache.render(template, { name: elgg.get_logged_in_user_entity().name }); $('body').html(view); });

Docs

  • mustache.js https://github.com/janl/mustache.js
  • PHP Mustache https://github.com/bobthecow/mustache.php

The Versions

02/10 2015

dev-dev

dev-dev http://hypejunction.com

Mustache templating in Elgg

  Sources   Download

GPL-2.0

The Requires

 

The Development Requires

by Ismayil Khayredinov

plugin mustache templates elgg

02/10 2015

1.0.0

1.0.0.0 http://hypejunction.com

Mustache templating in Elgg

  Sources   Download

GPL-2.0

The Requires

 

The Development Requires

by Ismayil Khayredinov

plugin mustache templates elgg

02/10 2015

dev-master

9999999-dev http://hypejunction.com

Mustache templating in Elgg

  Sources   Download

GPL-2.0

The Requires

 

The Development Requires

by Ismayil Khayredinov

plugin mustache templates elgg