PHP Classes
elePHPant
Icontem

Simple-Template: Template engine based on PHP scripts

Recommend this page to a friend!
  Info   View files View files (24)   DownloadInstall with Composer Download .zip   Reputation   Support forum   Blog    
Last Updated Ratings Unique User Downloads Download Rankings
2010-12-21 (5 years ago) RSS 2.0 feedNot enough user ratingsTotal: 595 All time: 4,971 This week: 1,113Up
Version License PHP version Categories
simple-template 1.0Freeware5.0PHP 5, Templates
Description Author

This package implements a template engine based on PHP template scripts.

It includes PHP template scripts so they are executed and the main class captures its output.

The template scripts may class functions of previously registered helper classes.

Picture of Michele Brodoloni
  Performance   Level  
Name: Michele Brodoloni <contact>
Classes: 6 packages by
Country: Italy Italy
Innovation award
Innovation award
Nominee: 3x

Details
SimpleTemplate PHP Template Engine 
(written by Michele Brodoloni <mik (dot) linux (at) gmail (dot) com>)

------------------------------------------------------------------------
23-Jun-2011
IMPORTANT NOTE:
This project has been moved to sourceforge due to practical reasons.

There you can find a more updated version of this class which include:
- Helpers autoloading with custom options
- Possibility to keep templates/helpers/etc. out of the web root
- Several fixes on trunk code
- An extensive example on how to use the template engine (still in development)

You can checkout the whole project using SVN:

svn co https://simple-template.svn.sourceforge.net/svnroot/simple-template/trunk simple-template


------------------------------------------------------------------------

.:: INTRODUCTION ::.

This is a simple template engine I wrote to accomplish the goal of separating
the business logic from presentation and would like to avoid using complex
template engines like Smarty. 

It has been inspired by the Zend_View component of the Zend Framework.
Try it and let me know you what you think.


.:: DEPENDENCIES ::.

- PHP 5 or higher


.:: FEATURES ::.

- PHP code is simple to understand
- PHP code uses phpDocumentor commenting style.
- Light and easy to use
- Template helpers support (global and per single view)
- Template header and footer support
- Possibility to include templates within templates
- Support for template logic (as we use PHP for templating language)
- No *tag-search-n-replace* overhead 
- Extensible and customizable (as of OOP pattern)
- More... :)

.:: EXAMPLES & DOCUMENTATION ::.

See the attached examples files for more information.

Just download the whole package and extract it into a web directory.
After that, just call an exampleN.php script within you browser and have fun.

About the documentation: this is my first attempt to use phpDocumentor
(www.phpdoc.org), and it may be incomplete and non-working, so,
if you can give me hints on how to fix this, or maybe fix it for me, 
this would be really appreciated.


.:: SUPPORT ::.

If you liked this class and decided to employ it on your site/blog/webapp,
you are pleased to let me know, and if you wish, you may offer me a 
coffee using the paypal donation button on example4.php. Thanks.

If you made efforts to add features, bugfixes, complain about the
uselessness of this class, or you simply want to leave a personal comment, 
you are welcome to write me, and explain what you have done and why.
  Files folder image Files  
File Role Description
Files folder imageimages (1 file)
Files folder imageinclude (3 files, 1 directory)
Files folder imagetemplates (5 files, 3 directories)
Accessible without login Plain text file README.txt Doc. README File
Plain text file common.php Example Common include file
Plain text file example1.php Example Example Script #1
Plain text file example2.php Example Example Script #2
Plain text file example3.php Example Example Script #3
Plain text file example4.php Example Example Script #4
Plain text file example5.php Example Example Script #5

  Files folder image Files  /  images  
File Role Description
  Image file smiley.png Icon Sample image

  Files folder image Files  /  include  
File Role Description
Files folder imagehelpers (2 files)
  Plain text file class.simpletemplate.php Class SimpleTemplate Class
  Plain text file class.simpletemplatehelper.php Class SimpleTemplateHelper Class
  Plain text file class.simpletemplateview.php Class SimpleTemplateView Class

  Files folder image Files  /  include  /  helpers  
File Role Description
  Plain text file html.helper.php Class HTML Helper Class
  Plain text file paypal.helper.php Class PayPal Helper Class

  Files folder image Files  /  templates  
File Role Description
Files folder imageexample2 (2 files)
Files folder imageexample3 (2 files)
Files folder imagesource (2 files)
  Plain text file example1.template.php Example Example Template #1
  Plain text file example2.template.php Example Example Template #2
  Plain text file example3.template.php Example Example Template #3
  Plain text file example4.template.php Example Example Template #4
  Plain text file example5.template.php Example Example Template #5

  Files folder image Files  /  templates  /  example2  
File Role Description
  Plain text file footer.template.php Example Example Template Footer #2
  Plain text file header.template.php Example Example Template Header #2

  Files folder image Files  /  templates  /  example3  
File Role Description
  Plain text file footer.template.php Example Example Template Footer #3
  Plain text file header.template.php Example Example Template Header #3

  Files folder image Files  /  templates  /  source  
File Role Description
  Plain text file show-php-source.template.php Aux. Example Script
  Plain text file show-source-link.template.php Aux. Example Script

 Version Control Unique User Downloads Download Rankings  
 0%
Total:595
This week:0
All time:4,971
This week:1,113Up