VlibTemplate

VlibTemplate

Infobox_Software
name = vlibTemplate

developer =
latest_release_version= 4.1.0
latest_release_date =
operating_system =
genre = Template Engine
license =
website = http://vlib.clausvb.de/

vlibTemplate is a template engine written in PHP. Programmers and web developers may use it for web development. vlibTemplate is a PHP class that is intended to make splitting PHP from HTML a simple and natural task. It makes use of the following vlibTemplate "markup tags" (like html tags); {tmpl_var}, {tmpl_loop} and so on.

The file written with these style tags is called a template. A template can be an HTML file to use on the web, or perhaps a text file to use as an e-mail template... as you can guess there are many many possibilities. The template file is always separate from the PHP script that uses it, that way, a designer for example can change the template file without having to go through all of the php coding, thus saving the developer having to worry about it.

Using this class you set the values for the variables, loops, if statements, etc. which are declared in the template. This enables you to separate all of the design from the data, which you create using PHP.

vlibTemplate is a part of "vLIB". It has an interface to "vlibDate" and "vlibMimeMail". You can program powerful web applications with vLIB.

Code example

Since vlibTemplate separates PHP from HTML, you have two files:

{tmpl_var name='title_text'}

{tmpl_var name='body_text'}

Note that this file contains plain HTML and one markup tag. TMPL_VAR is used to display template variables, which are assigned in the PHP script:
require_once 'vlib/vlibTemplate.php';

$tmpl = new vlibTemplate('tmpl/basic.htm');

$tmpl->setvar('title_text', 'TITLE: This is the vLIB basic example ...');$tmpl->setvar('body_text', 'BODY: This is the message set using setvar()');

$tmpl->pparse();

Even complicated designs can be programmed with vlibTemplate. You can use "vlibTemplateCache" to speed up the parsing process.

Features

* WYSIWYG: you can design and edit your templates with Frontpage, Dreamweaver or any other WYSIWYG HTML editor you can think of.
* Structure and Modularity: vlibTemplate will help you a great deal about modularity and structure of your code. It will help you to create cleaner code, too.
* Template includes: you can include a template file from within another template file so, for example, you can have a site footer that you point to from each template, if you needed to change the footer, it can be done simply by editing 1 file.
* Template loops: you can set up loops in your template for maybe showing the result of a database query. You can use "setdbloop" and let handle vlibTemplate the "$result" (e.g. returned by "mysql_query", "pg_query" or "ora_do"). vlibTemplate can handle a lot of RDBMS like: MySQL, PostgreSQL, Oracle, Informix and others.
* Template conditions: you can actually use boolean conditions in your template (), this can be handy for displaying different color in a table, or showing a list of results in a search page.
* Template caching: you can cache your templates to a file which means that vlibTemplate reads the template from the cache (which is already compiled) and thus can save much time while writing a page.
* Template debugging: if you want to see exactly what's being used by vTemplae you can see by using vlibTemplateDebug. This class will output an HTML-formatted page with all data needed to see where you're going wrong. It will even tell you if there are errors in the way you've written the template.

External links

* [http://dl.clausvb.de/ Download]
* [http://vlib.clausvb.de/ vLIB (English)]
* [http://lamp.clausvb.de/ vLIB (German)]
* [http://vlib.clausvb.de/docs/multihtml/vlibtemplate/table_of_content.html Documentation and reference (English)]
* [http://lamp.clausvb.de/vlib_mhtml/table_of_content.html Introduction and tutorial (German)]
* [http://vlib.clausvb.de/forum/index.php vLIB forums]
* [http://vlib.clausvb.de/benchmarks/ Benchmarks]


Wikimedia Foundation. 2010.

Игры ⚽ Нужна курсовая?

Look at other dictionaries:

  • Templatesprache — Eine Template Engine (von engl. Vorlage und Antrieb, Motor) ist eine Software, die eine Datei (das Template) verarbeitet, und bestimmte Platzhalter darin mit jeweils aktuellen Inhalten füllt. Die Bezeichnungen Templateklasse und Templatesystem… …   Deutsch Wikipedia

  • Templatesystem — Eine Template Engine (von engl. Vorlage und Antrieb, Motor) ist eine Software, die eine Datei (das Template) verarbeitet, und bestimmte Platzhalter darin mit jeweils aktuellen Inhalten füllt. Die Bezeichnungen Templateklasse und Templatesystem… …   Deutsch Wikipedia

  • Template engine (web) — A (web) template engine is software that is designed to process web templates and content information to produce output web documents. It runs in the context of a template system.pecific types of template engines Template engine is ordinarily… …   Wikipedia

  • TinyButStrong — Infobox Software name = TinyButStrong developer = latest release version= 3.4.0 latest release date = release date|2008|06|16 operating system = Cross platform genre = Template Engine license = website = http://www.tinybutstrong.com/TinyButStrong …   Wikipedia

  • Template Engine — Dieser Artikel wurde aufgrund von inhaltlichen Mängeln auf der Qualitätssicherungsseite der Redaktion Informatik eingetragen. Dies geschieht, um die Qualität der Artikel aus dem Themengebiet Informatik auf ein akzeptables Niveau zu bringen. Hilf… …   Deutsch Wikipedia

Share the article and excerpts

Direct link
Do a right-click on the link above
and select “Copy Link”