Delivering the best Add-Ons in more than 37 languages.

中文(简体), English, हिन्दी/हिंदी, Español/Castellano, العربية, Русский язык, Français, 中文 (台灣), বাংলা, Bahasa Indonesia, اردو, Português, Deutsch, Bahasa Melayu (بهاس ملايو‎), 日本語 (にほんご), فارسی, Italiano, తెలుగు, Türkçe, ગુજરાતી, Język polski/polszczyzna, Tiếng Việt, ಕನ್ನಡ, Українська мова, ไทย
PHP Scripts / Miscellaneous

Advanced PHP Template Preprocessor

— Add-On to

Subscribe to our feed to stay up to date!

New! Follow us as you want it!

Advanced PHP Template Preprocessor - CodeCanyon Item for Sale


Ad: Bluehost hosting


In it’s most basic form, PHP Template Preprocessor can replace tags with values set in PHP, but it also has an advanced sort of “syntax” that you can use.

How to use

 echo Element("template.html", Array( "something" => "something" )); 



You can specify the defaults for a variable, which are used when the value isn’t specified by the PHP script.


These are basically “if” statements.


You can parse an Array to the template, and make it iterate through it.


You can use arrays, infinitely, like so:


PHP Variables

If you enable this, you can access global PHP variables by using “{$something}”.


This script is optimized for performance. An average template shouldn’t take more than 0.001 seconds to process. That’s one millisecond! That time generally increases (slightly) as more tags and layers are added, but you will probably never see it go over 0.005 seconds (5 milliseconds).

Infinite recursion

You can add as many layers of tags as you want.

For example, you could use…


... And it would still be processed accordingly. There is no limit to recursion.

Other components in this categoryAll components of this author
CommentsFrequently asked questions and answers


15 October 10

Last Update:

Compatible Browsers:
IE6, IE7, IE8, Firefox, Safari, Opera, Chrome 4, Chrome 5

Files Included:

Software Version:
PHP 5.x


eCommerce, eCommerce, All Items, display, html, parse, preprocessor, template