SourceForge Logo
Y.A.T.S.
Yet Another Template System (for PHP)

About YATS
  Summary
  Features
  Projects
  License

Documentation
  Usage Doc
  API

SourceForge
  Project Page
  Downloads
  Mailing List
  Forums
  Bug Reports
  Feature Requests
  CVS Access

Other PHP Template Systems
  FastTemplate
  Cached FastTemplate
  Smarty
  Abstract Presentation Layer

In a Nutshell

YATS is a templating system that was originally inspired by FastTemplate, the primary goal of which is to separate HTML content from PHP code.  FastTemplate is widely used because it makes maintenance of large sites easier. Programmers can work on the logic while designers work on the templates separately. YATS seeks to preserve these features while improving on usability and speed.  It is not a direct port of FastTemplate, as it adds/removes some features, changes the syntax, and simplifies a few things, such as template definition. 

The PHP version of FastTemplate is implemented as a native PHP class and uses regular expressions for parsing.  This means two things: the templating code must be interpreted for each request, and the template must be re-parsed for each request (or sometimes even more often).  By comparison, YATS is written in C as a PHP module, so it is always available.  Further, it parses the template only once into a set of stored data structures and uses these to quickly substitute new variables on subsequent calls to retrieve the template contents. The file is not re-parsed unless it changes or a new server process begins, no matter how many requests occur. Finally, YATS adds some additional features such as multiple nested sections within a template, and implicit looping within sections.

YATS >= 0.93 supports the GNU gettext library/tools and utilizes special tags to mark certain content for inclusion in the translation catalog. This allows creation of a single set of HTML templates that can be used to display your site in multiple languages.

Various iterations of this code have been/are running at Epinions.com and are sufficiently fast for the high traffic volume this site encounters, with several YATS templates used for each user http request. No specific speed claims are made. Your mileage may vary.

Questions or Comments?

If it is regarding a feature request or bug report, please use the appropriate sourceforge reporting mechanism (linked).

Otherwise send us a note: yats-devel@lists.sourceforge.net