Templights

Lightweight PHP templating
Download

Templights Ranking & Summary

Advertisement

  • Rating:
  • License:
  • GPL v3
  • Price:
  • FREE
  • Publisher Name:
  • Gregor Mazovec
  • Publisher web site:
  • http://code.google.com/u/gregor.mazovec/

Templights Tags


Templights Description

Lightweight PHP templating Templights is template system that uses PHP as template language and has a powerful multiple inheritance support. Small memory footprint (about 20K) and efficient implementation results in very good performance of template system.SyntaxTemplates consists of blocks which can be nested or extended. Blocks are defined by open tag {% and closed by close tag %}. After open tag name of block must be defined. Block name must be uppercase alphanumeric word. Content of block is defined inside curly braces.Example:{% BLOCK {This is content of a block named BLOCK. {% SUB { This is sub-block named SUB. }%}}%}Blocks can be extended simply by replacing block name with parent template filename.Example:{% template.tpl {{% BLOCK {This content will override content of block named BLOCK from template file template.tpl}%}}%}Inside blocks PHP tags can be included. It is recommended to use PHP alternative syntax for control structures for more readable code.Example:{% LIST {< ? if ($list) : ? >< ul >< ? foreach ($list as $item) : ? >< li >< ?= $item; ? >< /li >< ? endforeach; ? >< /ul >< ? endif; ? >}%}Comments are enclosed by {%% and %%} tags.Example:{%% This is one line comment! %%}{%%Commentscan be spreadedover many lines.%%} What's New in This Release: · This release adds support for empty blocks, corrects whitespace rendering, and updates examples. · TPL_BASE constant is deprecated. · Two critical bugs were fixed.


Templights Related Software