Download Shareware and Freeware Software for Windows, Linux, Macintosh, PDA

line Home  |  About Us  |  Link To Us  |  FAQ  |  Contact

Serving Software Downloads in 956 Categories, Downloaded 50.201.614 Times

PHP MicroTemplate 1.0.0

  Date Added: May 10, 2013  |  Visits: 476

PHP MicroTemplate

Report Broken Link
Printer Friendly Version


Product Homepage
Download (58 downloads)



This class provides an extremely fast, lightweight templating system for HTML and other text-based documents. Like FastTemplate and its many clones, MTPL supports nested blocks and looping. However, the entire implementation is done without a single regular expression. The PHP interpreter is leveraged for its built-in variable interpolation, and explode() is used to separate block markers from content using a simple delimiter. As a result, the overhead of reading and parsing template files is minimal. This should eliminate the need for a cache and improve the overall performance of template- driven sites. Since PHP's dollar sign notation (ie. "$var") is used to identify content placeholders, it is sometimes necessary to escape dollar signs in your template (ie. "$$amount"). You can use arrays with the form $array[element]; just don't quote the index. $array['element'] or $array["element"] will generate PHP parse errors due to the way PHP evaluates hashes in a string context. For the same reason, multi-level arrays will not work ("$a[b][c]" becomes the value of $a[b] followed by the literal text "[c]"). Global variables can be accessed using the usual $GLOBALS[] array method. For instance, to get the script URL, you can use $GLOBALS[PHP_SELF]. There are a few other differences. The assign() method found in most PHP template classes is gone. Instead, all assigned variables must be provided as a hash that is passed to the parse() method. Since in almost every single case a series of assign()'s is done followed by a single call to parse(), this eliminates some redundancy. It also provides a more strict scoping to template variables which should result in scripts that are easier to debug. Two variations on parse() exist: parseLoop() and parseOut(). parseLoop() takes a list of hashes instead of a single hash of variables to assign and calls parse() on the same block for each. This allows you to populate tables and drop-downs without the need to write loops into your code. parseOut() iteratively calls parse() for a given block and each of its parents in order. For instance, parseOut('main.section.sub') will parse 'main.section.sub', then 'main.section', then 'main'. Both of these methods should reduce the amount of code you need to write for typical operations. You will also notice that there is no out(), text(), or print() method. Rather than holding onto all output internally, the parse() and related methods return the resulting output. To output the result of a parse operation, simply: echo parse(...); PHP's native error handling is used for all errors and warnings. In addition, by adding "error_handling(E_ALL);" to your scripts, the PHP interpreter will warn you about any uninitialized template variables. Granted, the error messages are a bit odd (since interpolation is done inside of an eval()), but this can be a good way to track down typos.

Requirements: No special requirements
Platforms: Windows, Mac, *nix, Mac OSX, Linux, PHP , BSD Solaris
Keyword: Class Php Php Classes Php Template Template Template Class
Users rating: 0/10

License: Freeware
USER REVIEWS
More Reviews or Write Review


PHP MICROTEMPLATE RELATED
Programming  -  PHP Template SKOR 1.0
PHP Template SKOR : The class can assign variable values. A separate class extends the base class to support delimited template section replacements. The goal of this template engine is to separated code (PHP) from markup. Easy and fast interface.
10.53 KB  
Development Tools  -  PHP Data Source Template Parser RC2 1.0
With this PHP template parser you can load in one huge array of information and use it in your template (html document). This system looks like similar implementations of the XML / XSL methods.The code is operating system independent and could be...
 
Development Tools  -  XiTemplate 1.0.1
XiTemplate is an easy to use and very fast PHP template engine. Although PHP is technically a template system by itself since PHP code and HTML code can coexist in the same file, XiTemplate addresses some common problems with this approach....
 
Development Tools  -  Yapter 2.14b2 1.0
Yapter is a PHP template engine.Using Yapter could come in handy at some points during web development. Yapter lets you separate your PHP code fully from the necessary HTML. If all your pages differ an awful lot from each other, using Yapter could...
 
Development Tools  -  phpPat 0.0.1a1 1.0
phpPat is an open-source php template engine. phpPat is extremely easy to use. It was build to increase the readability of your php scripts and enable you to fully practise your creativity. It can separate php code from html and perform complex...
 
Database Tools  -  TPLN 2.8
TPLN is a new template class written in php that could interface with your database (PDO, MySQL , mSQL , Sybase, Interbase ....) via AdoDB.PHP code is separated of the design what facilitates the update of the design of your documents and to...
 
Development Tools  -  Template Lite 2.1
Template Lite is a very fast, small HTML template engine written in PHP. The engine supports most of the Smarty template engine functions and filters. Template Lite has many advantages over other template engines, as well as a few disadvantages....
 
Development Tools  -  Php Object Template 1.3
The goal of Pot is to totally divide logic from the design. Pot can be used by ‘common’ people just writing some XML tags in the html code, that will be parsed by the Php Pot code to create the final working page. For ‘working page’ is...
 
Miscellaneous  -  EasyTPL 1.0
EasyTPL - Easy Template is a PHP class for developing a web site, separating PHP code and HTML documents. Dynamic blocks are autodetected and ready for usage instantly after defining templates. It allows pasting HTML parts into TAGS. etc. It is...
 
Development Tools  -  lilTC 0.0.1
lilTC, which stands for "a 'little' template class" is a lightweight PHP class or 'template engine', which can be used for filling any kind of templates (usually HTML pages) with dynamic data. lilTC is very easy to install and to use and it...
 
NEW DOWNLOADS IN SCRIPTS, MISCELLANEOUS
Scripts  -  Free Ecommerce website creator 1.2
Free Ecommerce website creator is a free PHP shop creating script. This allows you to put a online shop on your own website. Create your own free ecommerce website for Your Business. Create an online shop using easyGUI online shop creator. The...
1.44 KB  
Scripts  -  MochiGames PHP Script ZDR 1.00
MochiGames PHP Script ZDR is web site, ready for use, for flash games. These flash games are downloaded automatically by "MochiGames PHP Script ZDR" from MochiGames media. The use of the games is free, you can use your own Mochi Publisher ID and...
368.54 KB  
Scripts  -  Php Chat 2.0
Add a free php site, single sign-on and multiple skins, 100% free 1. Server Modes: The chat server has paid mode and free mode. If the free chat mode, a free chat room will be assigned to your website with your domain as the room name. 2....
938.87 KB  
Scripts  -  Nibbleblog 3.0.1
Nibbleblog it's a powerful engine for creation and manipulation of BLOG's completely free. Very simple to install and configure (Only 1 step). The database used is based on XML files and this way it is not necessary to use MySQL or similar DBMS....
371.09 KB  
Scripts  -  PHP File Manager | CloudOsys 2.9b8
CloudOsys is a PHP file manager, a tool that allows your visitors upload files such as media content directly to your website. Your visitors will upload files directly to your website, where they can share and comment on them. Through cloud...
1.41 MB  
Miscellaneous  -  ZZIPlib Library for File sharing 0.13.56
Different applications can group files together into a single .zip archive and access them afterward.The library uses only the patent-free compression-algorithms supported by Zlib.It provides functions that transparently access files being either...
675.84 KB  
Miscellaneous  -  Traveling Salesman Problem - Nearest Neighbor Script 1.1
This method produces different results depending on what city is choosen as the starting point.This function determines the Nearest Neighbor routes for multiple starting points and returns the best of those routes.
10 KB  
Miscellaneous  -  N/A Checkbox 6.x-1.8
N/A Checkbox will allow website builders to add a checkbox next to a number textfield. The idea is to provide the users a textfield to enter a numeric value, or mark N/A in case they don't have it. When the N/A option is marked, a different value...
10 KB  
Miscellaneous  -  ILIAS LMS 4.1.2
ILIAS is a web base learning management system (LMS, VLE).Features of ILIAS LMS:- Courses,- SCORM 1.2 and 2004,- mail,- forum,- chat,- groups,- podcast,- file sharing,- authoring,- CMS,- test,- wiki,- personal desktop,- LOM,- LDAP,- role based...
89 MB  
Miscellaneous  -  Scribe for WordPress 2.0.4
Scribe is an SEO software service for WordPress - think of it as a content optimization assistant - that analyzes web pages, blog posts, and online press releases at the click of a button.Scribe then tells web writers of any kind how to tweak...
10 KB