libhtmlTemplate 1.1.0
Sponsored Links
libhtmlTemplate 1.1.0 Ranking & Summary
File size:
0.026 MB
Platform:
Any Platform
License:
GPL (GNU General Public License)
Price:
Downloads:
1260
Date added:
2006-05-19
Publisher:
Rui Barreiros
libhtmlTemplate 1.1.0 description
libhtmlTemplate, is a library to aid developers to separate content from code. libhtmlTemplate is very simple, small and easy to use, its my first c++ project, so any feedback with the purpose of helping to improve the library is welcome as well as any bug report and feature request, ill be glad to help in what i can, and know.
Examples:
#include < htmlTemplate.h >
int main(int argc, char **argv) {
// There are three ways of instatiating a Template object
// This is the generic one
Template t;
// This one, predefines on instatiation the default path where the templates are
Template t_w_path("/var/www/html/templates");
// This one, predefines the path, and the template file
Template t_w_file_path("/var/www/html/template", "index.tpt");
// When you instatiate the template object as the generic one,
// the dir and file are the default ./ and index.tpt so
// if you want to change them, you must use the following methods
// Set the template dir
t.setDir("/var/www/mytemplatedir");
// Set the template file
t.setTemplate("mytemplate.tpt");
// Now you are ready to replace the predefined template values, with the ones you want
// Suppose you have a tag in the template, {{MYVALUE}}
// to place your value in his location just use addText(), notice the absense of {{ & }}
t.addText("MYVALUE", "This is my text");
// Now you can automatically display the result by calling playTemplate
cout << "Using playTemplate" << endl << t.playTemplate() << endl;
// Lets suppose you have in the index.tpt a tag called {{MYBLOCK}} (on the t_w_file_path object)
// and you want to place there the content of a parsed template, lets say mytemplate.tpt,
// simple, use the evaluateTemplate method, like this
cout << "Using evaluateTemplate" << endl;
t_w_file_path.addText("MYBLOCK", t.evaluateTemplate);
cout << t_w_file_path.playTemplate() << endl;
// simple right?
// there are also some util methods in case you ever need
// Returns the current defined dir
cout << "t object -> dir: " << t.getDir() << endl;
// Returns the current defined file
cout << "t object -> file: " << t.getTemplate() << endl;
// Returns the value defined for a tag
cout << "t object -> MYVALUE: " << t.getText("MYVALUE") << endl;
// now for all the other objects
cout << "t_w_path object -> dir: " << t_w_path.getDir() << endl;
cout << "t_w_path object -> file: " << t_w_path.getTemplate() << endl;
cout << "t_w_file_path object -> dir: " << t_w_file_path.getDir() << endl;
cout << "t_w_file_path object -> file: " << t_w_file_path.getTemplate() << endl;
// There is also another one that it has not much use for you,
// i used it only for debugging purposes
// Dumps the template file
cout << "t object Template file: " << endl;
cout << t.dumpFile() << endl;
return 0;
}
Enhancements:
- libhtmlTemplate: Patch by Brian Hsu to compile with GCC 3.X versions
Examples:
#include < htmlTemplate.h >
int main(int argc, char **argv) {
// There are three ways of instatiating a Template object
// This is the generic one
Template t;
// This one, predefines on instatiation the default path where the templates are
Template t_w_path("/var/www/html/templates");
// This one, predefines the path, and the template file
Template t_w_file_path("/var/www/html/template", "index.tpt");
// When you instatiate the template object as the generic one,
// the dir and file are the default ./ and index.tpt so
// if you want to change them, you must use the following methods
// Set the template dir
t.setDir("/var/www/mytemplatedir");
// Set the template file
t.setTemplate("mytemplate.tpt");
// Now you are ready to replace the predefined template values, with the ones you want
// Suppose you have a tag in the template, {{MYVALUE}}
// to place your value in his location just use addText(), notice the absense of {{ & }}
t.addText("MYVALUE", "This is my text");
// Now you can automatically display the result by calling playTemplate
cout << "Using playTemplate" << endl << t.playTemplate() << endl;
// Lets suppose you have in the index.tpt a tag called {{MYBLOCK}} (on the t_w_file_path object)
// and you want to place there the content of a parsed template, lets say mytemplate.tpt,
// simple, use the evaluateTemplate method, like this
cout << "Using evaluateTemplate" << endl;
t_w_file_path.addText("MYBLOCK", t.evaluateTemplate);
cout << t_w_file_path.playTemplate() << endl;
// simple right?
// there are also some util methods in case you ever need
// Returns the current defined dir
cout << "t object -> dir: " << t.getDir() << endl;
// Returns the current defined file
cout << "t object -> file: " << t.getTemplate() << endl;
// Returns the value defined for a tag
cout << "t object -> MYVALUE: " << t.getText("MYVALUE") << endl;
// now for all the other objects
cout << "t_w_path object -> dir: " << t_w_path.getDir() << endl;
cout << "t_w_path object -> file: " << t_w_path.getTemplate() << endl;
cout << "t_w_file_path object -> dir: " << t_w_file_path.getDir() << endl;
cout << "t_w_file_path object -> file: " << t_w_file_path.getTemplate() << endl;
// There is also another one that it has not much use for you,
// i used it only for debugging purposes
// Dumps the template file
cout << "t object Template file: " << endl;
cout << t.dumpFile() << endl;
return 0;
}
Enhancements:
- libhtmlTemplate: Patch by Brian Hsu to compile with GCC 3.X versions
libhtmlTemplate 1.1.0 Screenshot
libhtmlTemplate 1.1.0 Keywords
to separate
to aid
libhtmlTemplate
template
library
path
developers
aid
libhtmlTemplate 1.1.0
Libraries
Programming
Bookmark libhtmlTemplate 1.1.0
libhtmlTemplate 1.1.0 Copyright
WareSeeker periodically updates pricing and software information of libhtmlTemplate 1.1.0 full version from the publisher, so some information may be slightly out-of-date. You should confirm all information before relying on it. Software piracy is theft, Using crack, password, serial numbers, registration codes, key generators is illegal and prevent future development of libhtmlTemplate 1.1.0 Edition. Download links are directly from our publisher sites, torrent files or links from rapidshare.com, yousendit.com or megaupload.com are not allowed
Featured Software
Want to place your software product here?
Please contact us for consideration.
Contact WareSeeker.com
Related Information
template gallery
resume templates
templates microsoft
templates
templates wilson jones
templates dreamweaver
resume template
templates for resumes
microsoft templates
template monster
template resume
website templates
project templates
templates for business cards
templates photoshop
templates for powerpoint
invoice template
template tutorial
Related Software
libmysqltemplate is a very high speed C state machine template library that uses MySQL data for the source of the templates and Free Download
libtemplate is a C template library for CGI programs. Free Download
HTML::Template module attempts to make using HTML templates simple and natural. Free Download
The MfGames.Template library is a C# native library for creating template libaries. Free Download
Dicop::Item::Template is an object defining Dicop::Item subclasses. Free Download
Templayer is a layered template library for Python. Free Download
MAT is a C++ mathematical template class library. Free Download
Template::Alloy is a TT2/3, HT, HTE, Tmpl, and Velocity Engine. Free Download
Latest Software
Popular Software
Favourite Software