Populate template with JSON data: Replace templates using values from a JSON object

Recommend this page to a friend!
  Info   View files Example   Screenshots Screenshots   View files View files (4)   DownloadInstall with Composer Download .zip   Reputation   Support forum   Blog (1)    
Last Updated Ratings Unique User Downloads Download Rankings
2021-09-12 (1 month ago) RSS 2.0 feedNot yet rated by the usersTotal: 70 This week: 28All time: 9,865 This week: 5Up
Version License PHP version Categories
ssreplacer 1.0.0GNU General Publi...5PHP 5, Templates
Description Author

This class provides a package to replace templates using values from a JSON object.

It can take a template file and a file with JSON object stored as a string and it replaces the marks in the template using values from the JSON object.

The class can process the template and return a string with template parameter values from the JSON object inserted in the marks.

Innovation Award
PHP Programming Innovation award nominee
September 2021
Nominee
Vote
Templates are a widespread way to define the format of the output of a page.

Inside each template file, you have marks that you will replace with template parameter values.

Usually, you can set the template parameters using code that calls a template engine component.

This package provides an alternative for processing templates. It can read the template parameters from files that define the parameter values in the JSON format.

Manuel Lemos
Picture of Satish B
  Performance   Level  
Name: Satish B is available for providing paid consulting. Contact Satish B .
Classes: 1 package by
Country: India India
Age: ???
All time rank: 4386306 in India India
Week rank: 8 Up1 in India India Up
Innovation award
Innovation award
Nominee: 1x

Screenshots  
  • replacerDemo.png
  • replacerDemo2.png
  Files folder image Files  
File Role Description
Plain text file class.ssReplacer.php Class replacer class
Accessible without login Plain text file data.txt Data Sample data
Accessible without login Plain text file replacerDemo.php Example Demo php explaining the class usage
Accessible without login HTML file template01.html Data sample template

 Version Control Unique User Downloads Download Rankings  
 0%
Total:70
This week:28
All time:9,865
This week:5Up
For more information send a message to info at phpclasses dot org.