2017 © Pedro Peláez
 

library php-nano-template

The php-nano-template class replaces placeholders in a string with values from an array.

image

azettl/php-nano-template

The php-nano-template class replaces placeholders in a string with values from an array.

  • Wednesday, August 9, 2017
  • by azettl
  • Repository
  • 1 Watchers
  • 0 Stars
  • 14 Installations
  • PHP
  • 1 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 4 Versions
  • 27 % Grown

The README.md

php-nano-template - Template Engine

Codacy Badge, (*1)

The php-nano-template class replaces placeholders in a string with values from an array., (*2)

Installation

composer require azettl/php-nano-template

Usage

$nano = new com\azettl\nano\template();
$nano->setTemplate(
  "

{user.greeting()} {user.function(2)} {user.function('test')} {user.first_name} {user.last name}! Your account is {user.account.status} {user.nonexistingnode} , (*3)

" ); $nano->setData($aData); $nano->setShowEmpty(true); echo $nano->render();

or, (*4)

$nano = new com\azettl\nano\template(
  "

{user.greeting()} {user.first_name} {user.last name}! Your account is {user.account.status} {user.nonexistingnode} , (*5)

", [ "user" => [ "login" => "demo", "first_name" => "Anon", "last name" => "Ymous", "account" => [ "status" => "active", "expires_at" => "2016-12-31" ], "greeting" => function(){ return 'Hello'; }, "function" => function($param){ return 'Test' . $param; } ] ] ); echo $nano->render();

or, (*6)

$nano = new com\azettl\nano\template();
$nano->setTemplateFile(
  "tests/template.html"
);
$nano->setData($aData);

echo $nano->render(); 

The Versions

09/08 2017

dev-master

9999999-dev

The php-nano-template class replaces placeholders in a string with values from an array.

  Sources   Download

MIT

The Requires

  • php ^7.1

 

The Development Requires

by Andreas Zettl

template engine

02/08 2017

0.0.3

0.0.3.0

The php-nano-template class replaces placeholders in a string with values from an array.

  Sources   Download

MIT

The Requires

  • php ^7.1

 

by Andreas Zettl

template engine

02/08 2017

0.0.2

0.0.2.0

The php-nano-template class replaces placeholders in a string with values from an array.

  Sources   Download

MIT

The Requires

  • php ^7.1

 

by Andreas Zettl

template engine

01/08 2017

0.0.1

0.0.1.0

The php-nano-template class replaces placeholders in a string with values from an array.

  Sources   Download

MIT

The Requires

  • php ^7.1

 

by Andreas Zettl

template engine