2017 © Pedro PelĂĄez
 

library dot-php

PHP rendering engine for doT.js (The fastest + concise javascript template engine for nodejs and browsers)

image

seblucas/dot-php

PHP rendering engine for doT.js (The fastest + concise javascript template engine for nodejs and browsers)

  • Sunday, July 3, 2016
  • by mbirth
  • Repository
  • 1 Watchers
  • 3 Stars
  • 1,974 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 2 Forks
  • 0 Open issues
  • 2 Versions
  • 13 % Grown

The README.md

doT-php

PHP rendering engine for doT.js (The fastest + concise javascript template engine for nodejs and browsers)., (*1)

How to use it

// Load the library
require_once('resources/doT-php/doT.php');

// Load the template
$page = file_get_contents('templates/page.html');

// instanciate the object
$template = new doT();

// Compile your templace in a PHP function ($dot)
$dot = $template->template($page);

// the data is simple PHP array
$data = array('title' => 'My custom title');

// Write the HTML
echo $dot($data);

Warning

It's far from complete. I needed it just to provide a server side rendering engine for another project (COPS)., (*2)

So the code provided works perfectly for the templates of COPS and was never tested elsewhere, doT's unit test were also never tested., (*3)

That being said, You can fork, enhance it and send me some pull request, I'll happily merge them., (*4)

The Versions

03/07 2016

dev-master

9999999-dev https://github.com/seblucas/doT-php

PHP rendering engine for doT.js (The fastest + concise javascript template engine for nodejs and browsers)

  Sources   Download

GPL-2.0

The Requires

  • php >=5.3.0

 

dot template engine rendering

03/07 2016

1.0.0

1.0.0.0 https://github.com/seblucas/doT-php

PHP rendering engine for doT.js (The fastest + concise javascript template engine for nodejs and browsers)

  Sources   Download

GPL-2.0

The Requires

  • php >=5.3.0

 

dot template engine rendering