PHP Classes

Sirenade PHP Template Compiler: Compile templates to PHP and caches the results

Recommend this page to a friend!
  Info   View files Example   View files View files (11)   DownloadInstall with Composer Download .zip   Reputation   Support forum   Blog    
Ratings Unique User Downloads Download Rankings
Not yet rated by the usersTotal: 37 All time: 10,403 This week: 175Up
Version License PHP version Categories
sirenade 1.1Custom (specified...7Cache, Templates, Code Generation, PHP 7
Description Author

This package can compile templates to PHP and caches the results.

It extends the SIREN class to implement a template processing engine that can process templates defined as strings.

The engine generates a PHP script that will output the template processing results when it is executed.

The results of the template compilation are stored in cache files to reduce the time to process the same template again.

The template engine can process templates that may have marks that determine if a section is processed according to condition. It can also iterate over a section to process it in a loop.

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

SIRENADE is a base PHP library that compiles the template text into native PHP and caches the compiled output. It is using the package SIREN for basic functions.

SIREN has a simple, sufficient API, performs recursive replacement, and uses an intuitive syntax.  

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

SIRENADE allows for embedding native PHP in the template text and features a nice set of logic directives:

if - elseif - else  
while and loop with count  
for - and foreach struvtures  
increment / decrement counts  
break and continue  
global strings thru sprintf  
set and unset variables (i.e. template variables)
<?php .... ?>  
(experimental) ASP logic

Like SIREN, it features recursion in an intuitive way and extends SIREN's usage with

syntax {!<simple logic>!}
       {!!<advanced logic>!!}
       {# <comments> #}
       <!-- <comments> -->
       <?php <custom native PHP> ?>
       <?= <scalar> ?>
       {$<global string variable> <parameter>}
       <% <ASP logic> %>
       <%= <scalar> %>

SIRENADE has all logic expansions and their syntax externally defined as anonymous functions, and allows for simple custom adjustments, or even complete customised additions. See the directory './logic'.

SIRENADE can cache files and blocks on demand, leaving the SIREN recursion for run time expansion. SIRENADE comes with an extensive set of configurable options.

SIRENADE is very fast, not depending on the number of markers, nor the volume of logic.

More documentation: full readme, api docs, logic, license.

  Files folder image Files  
File Role Description
Files folder imagelicense (3 files)
Files folder imagelogic (1 file)
Accessible without login Plain text file code_of_conduct.md Doc. ethics
Accessible without login Plain text file demo.php Example demo source
Accessible without login Plain text file description.md Doc. explanation
Accessible without login HTML file developer.manual.html Doc. manual
Accessible without login Plain text file sirenade.usage.md Doc. api docs
Plain text file Stencil.class.php Class caching class
Plain text file Template.class.php Class compiling class

  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 Doc. license options

  Files folder image Files  /  logic  
File Role Description
  Accessible without login Plain text file default.inc.php Conf. configuration logic

Downloadsirenade-2021-02-13.zip 29KB
Downloadsirenade-2021-02-13.tar.gz
Install with ComposerInstall with Composer
Needed packages  
Class DownloadWhy it is needed Dependency
SIREN PHP Templating Library Download .zip .tar.gz Parsing and Substituting is left to Siren or any other package that supports it using the same method names. Required
 Version Control Unique User Downloads Download Rankings  
 0%
Total:37
This week:0
All time:10,403
This week:175Up
For more information send a message to info at phpclasses dot org.