PHP Classes

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)    
Ratings Unique User Downloads Download Rankings
Not yet rated by the usersTotal: 100 All time: 9,658 This week: 189Up
Version License PHP version Categories
ssreplacer 1.0.1GNU 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
Number 8
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 <contact>
Classes: 1 package by
Country: India India
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:100
This week:0
All time:9,658
This week:189Up