PHP Classes
elePHPant
Icontem

Div PHP Template Engine: Template processing engine that replaces tags

Recommend this page to a friend!
  Info   View files View files (13)   DownloadInstall with Composer Download .zip   Reputation   Support forum (1)   Blog    
Last Updated Ratings Unique User Downloads Download Rankings
2017-10-25 (26 days ago) RSS 2.0 feedNot enough user ratingsTotal: 662 This week: 1All time: 4,702 This week: 627Up
Version License PHP version Categories
div 4.12GNU General Publi...5.0PHP 5, Templates, Code Generation
Collaborate with this project Author

divengine.div - github.com

Description

This package implements a template processing engine that replaces tags.

It can load a given template file and replace tags by values, as well implement other content processing constructs.

Currently it supports string replacements, date replacements, math formula replacements, loop sections, conditional sections, template inclusion, template inheritance, data transformation, etc..

  Performance   Level  
Name: Rafael Rodriguez <contact>
Classes: 4 packages by
Country: Cuba Cuba
Age: 31
All time rank: 19114 in Cuba Cuba
Week rank: 540 Up3 in Cuba Cuba Up
Innovation award
Innovation award
Nominee: 2x

Details
---------------------------------------
[[]] Div PHP Template Engine 4.8
---------------------------------------
by Rafa Rodríguez (rafacuba2015@gmail.com)

Div is a template engine for PHP developed by the Eng. Rafa Rodriguez in 2011, 
that allows the separation of labor between the programmer and the designer. 
As the designer built templates with some specific tags, the programmer uses 
the template to replace these tags with the information. Div have a compact 
a descriptive syntax for template's designers.
	
Of course, the replacement of tags is a basic functionality. More extensions 
of the substitutions exist, for example, replace repeatedly N times, replace 
conditionally, among others.
	
The programmer creates an instance of a class with 2 parameters: the first 
is the designer's code or name of the file that he built, and the second is 
the information represented by an array, objects, or a combination of arrays 
and objects to replace the design's tags. The array's indexes, array's keys 
and object's properties must correspond with the design's tags.
	
The designer work in text files and use various types of tags: simple 
replacements, lists or loops, iterations, conditional parts, separating the 
design into different files, default replacements, and so on.
	
The syntax of Div is very compact. If the programmer wants to do a loop, the 
designer only needs to know a name for that loop, and if he wants to hide a 
part of the GUI, the designer is only responsible for tag the part that will 
be hidden or displayed conditionally.

Our reasons? Div is developed with the philosophy of the knowledge reused. 
Of course, Div is released in time of recognized template engines that are 
widely used. For this reason, Div develop a minimum new knowledge so that 
the developers can quickly become familiar with this engine and they can 
understand when, how and why to use it.

The features are added if it is really necessary. That is, if there is a need 
to add another functionality, we first analyzed whether there is a mechanism 
to resolve this functionality, and then we publish an article that explains 
how to implement this mechanism.
	
The argument to develop Div was obtained from various tests with PHP and we 
concluded that it is faster replace the portions of string than includes of 
PHP scripts.

The fact remains, that the replacement of substrings is a fast process but 
it require more memory. However, this consumption is so small that it is 
worthwhile the sacrifice.
	
Div development is to avoid creating a cache system because we believe that 
it is unnecessary according	to their characteristics as an engine. A learning 
system can be sufficient: it can prevent the repeated processing of the same 
templates.
	
Finally, it is known that the most popular engines are composed of more than 
one file, classes and libraries. Div sought since its inception, the 
implementation of everything in one class, in a single file. This allows easy 
adaptation to existing development platforms.

Goals? One class, one file!, considering the template like an object, 
create a minimum of highly descriptive syntax, avoid a cache system, improve 
the algorithms, reuse the knowledge, write mechanisms and extend!.
	
Possibilities for the designer? The designer carries out its work in text 
files and then the designer can use different tags. Div does not provide for 
the design obtrusive code. All that is programmed in the templates has a single 
goal: design.

Possibilities for the programmer? The programmer creates an instance of div 
class, specifying in its constructor, the template	created by the designer 
and the information that will be displayed.
	
For more information visit our site http://divengine.com and
the documentation div.html or https://github.com/rrodriguezr/div/wiki

Enjoy!

rafa
  Files folder image Files  
File Role Description
Accessible without login Plain text file CHANGELOG.txt Data first pull
Accessible without login Plain text file composer.json Data composer setup
Accessible without login Plain text file div-cli.php Example Example script
Accessible without login Plain text file div.bat Data Auxiliary data
Accessible without login HTML file div.html Doc. official documentation
Plain text file div.php Class first pull
Accessible without login Plain text file example.php Example example
Accessible without login Plain text file example.tpl Data example
Accessible without login Plain text file FUTURE.md Data Auxiliary data
Accessible without login Plain text file LICENSE Data new repo
Accessible without login Plain text file LICENSE.txt Lic. first pull
Accessible without login Plain text file README.md Data new repo
Accessible without login Plain text file README.txt Doc. first pull

 Version Control Unique User Downloads Download Rankings  
 84%
Total:662
This week:1
All time:4,702
This week:627Up