PHP Classes

SIREN PHP Templating Library: Template engine featuring recursion and nesting

Recommend this page to a friend!
  Info   View files Example   View files View files (12)   DownloadInstall with Composer Download .zip   Reputation   Support forum   Blog (1)    
Ratings Unique User Downloads Download Rankings
Not yet rated by the usersTotal: 96 All time: 9,643 This week: 141Up
Version License PHP version Categories
siren 2.2.4Custom (specified...7Templates, Parsers, PHP 7
Description Author

This package provides a template engine featuring nesting and inclusion.

It provides one base template engine processing class that can parse templates and replace variables with support of recursion.

There is also a sub-class that can also process templates that include other template files and supports nesting of template blocks.

Picture of wim niemans
  Performance   Level  
Name: wim niemans <contact>
Classes: 6 packages by
Country: The Netherlands The Netherlands
Innovation award
Innovation award
Nominee: 2x

Details

SIREN is a base PHP library to do templating in one go. It has a simple, sufficient API, performs recursive replacement, and uses an intuitive syntax. That's all you need.

syntax: {[$|?]var} where var  is [text]{var}[text]  
                   where text is '-._[\w\d\]'

SIREN features a (key, value) array of variables and exercises PCRE patterns to parse text. The library supports recursion, including files and processing of blocks.

Release 1.
    Allows setFile to refresh the var.
    Added the (internal) vars templateLocation and debugInfo.
    Added Global Variables: varNames starting with '$'.
Release 2.
    Added setVardata() to escape its value from parsing.
    Introduced recursionDepth, default is 'auto'.
    Allow recursionDepth manipulation.
    Added conditional varValues: varNames starting with '?'.

More documentation: full readme, howto use recursion, api docs, license.

  Files folder image Files  
File Role Description
Files folder imageexamples (1 file)
Files folder imagelicense (3 files)
Accessible without login Plain text file code_of_conduct.md Doc. code of conduct
Accessible without login Plain text file demo.php Example demo
Accessible without login Plain text file description.md Doc. short readme
Accessible without login Plain text file readme.md Doc. readme
Accessible without login Plain text file recursion.md Doc. Howto use recursion in SIREN using simple PHP
Accessible without login Plain text file siren.usage.md Doc. api docs
Plain text file Snippet.class.php Class base class for templates.
Plain text file Templet.class.php Class class that extends Snippet.

  Files folder image Files  /  examples  
File Role Description
  Accessible without login Plain text file sqlSnippet.class.php Example example of an application for education / studying purposes only

  Files folder image Files  /  license  
File Role Description
  Accessible without login Plain text file CDDL_1.LICENSE Lic. CDDL license
  Accessible without login Plain text file EUPL-1.2.LICENSE Lic. EUPL license
  Accessible without login Plain text file readme.md Lic. license options

 Version Control Reuses Unique User Downloads Download Rankings  
 0%1
Total:96
This week:0
All time:9,643
This week:141Up
For more information send a message to info at phpclasses dot org.