SIREN PHP Templating Library: Template engine featuring recursion and nesting

Recommend this page to a friend!
  Info   View files Example   View files View files (11)   DownloadInstall with Composer Download .zip   Reputation   Support forum   Blog (1)    
Last Updated Ratings Unique User Downloads Download Rankings
2020-10-16 (11 days ago) RSS 2.0 feedNot yet rated by the usersTotal: 68 This week: 2All time: 9,736 This week: 88Up
Version License PHP version Categories
siren 2.2.2Custom (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: 3 packages by
Country: The Netherlands The Netherlands
Age: 70
All time rank: 386396 in The Netherlands The Netherlands
Week rank: 41 Up3 in The Netherlands The Netherlands Up
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

  Files folder image Files  
File Role Description
Files folder imageexamples (1 file)
Files folder imagelicense (2 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

 Version Control Unique User Downloads Download Rankings  
 0%
Total:68
This week:2
All time:9,736
This week:88Up

For more information send a message to info at phpclasses dot org.