2017 © Pedro Peláez
 

library nano-template

Nano template engine with PHP5 language

image

ichigotake/nano-template

Nano template engine with PHP5 language

  • Saturday, December 7, 2013
  • by ichigotake
  • Repository
  • 1 Watchers
  • 1 Stars
  • 4 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 1 Open issues
  • 1 Versions
  • 0 % Grown

The README.md

NAME

NanoTemplate - Nano template engine with PHP5 language, (*1)

USAGE

All function in example. This module is verrrry simply!, (*2)

very simply call, (*3)

require 'lib/NanoTemplate.php';

# render($view_file, $binds, $charset);
# 
# The second and the following arguments is optional.
# Default charset is "UTF-8"
render('/path/to/view.php', array(
    'greet' => 'hahaha',
    'greet_jp' => 'ごきげんよう',
));

or, make instance, (*4)

### index.php
# param(optional): ($view = 'view/', $charset = 'UTF-8')
$t = new NanoTemplate('view/');

# echo template with bind variable
$t->render('template.php', array(
    'greet'    => 'Hello!!',
    'greet_jp' => 'こんにちは!',
));

### view/template.php
<?php $_layout = 'layout.php' ?>

<?php echo $greet_jp ?> (Japanese mean "<?php echo $greet ?>")

### view/layout.php
<!doctype html>
<html>
<head>
</head>
<body>
    <?php echo $_content ?>
</body>
</html>

Why naming Nano?

PHP template engine is already many exists. but almost theres is large or Web Application Framework dependencies., (*5)

NanoTemplate don't have expand syntax and assigned vars are not '$this'. also, if you want to assign object vars ;), (*6)

NanoeTemplate has only 1 pure PHP file. PHP is template engine it self, because nameing 'Nano'., (*7)

AUTHOR

ichigotake, (*8)

LICENSE

MIT LICENSE, (*9)

The Versions

07/12 2013

dev-master

9999999-dev https://github.com/ichigotake/php-NanoTemplate

Nano template engine with PHP5 language

  Sources   Download

MIT

The Requires

  • php >=5.3.3

 

by Avatar ichigotake