Location: PHPKode > projects > SithTemplate > SithTemplate-1.1/docs/html/index.html
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<title>SithTemplate: SithTemplate - open-source template engine for PHP5</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="doxygen.css" rel="stylesheet" type="text/css"/>
</head>
<body>
<!-- Generated by Doxygen 1.7.2 -->
<div class="navigation" id="top">
  <div class="tabs">
    <ul class="tablist">
      <li class="current"><a href="index.html"><span>Main&#160;Page</span></a></li>
      <li><a href="pages.html"><span>Related&#160;Pages</span></a></li>
      <li><a href="annotated.html"><span>Classes</span></a></li>
      <li><a href="files.html"><span>Files</span></a></li>
      <li><a href="examples.html"><span>Examples</span></a></li>
    </ul>
  </div>
</div>
<div class="header">
  <div class="headertitle">
<h1>SithTemplate - open-source template engine for PHP5 </h1>  </div>
</div>
<div class="contents">
<h3 class="version">1.1 </h3><h2><a class="anchor" id="license"></a>
Unlicense</h2>
<p>This is free and unencumbered software released into the public domain.</p>
<p>Anyone is free to copy, modify, publish, use, compile, sell, or distribute this software, either in source code form or as a compiled binary, for any purpose, commercial or non-commercial, and by any means.</p>
<p>In jurisdictions that recognize copyright laws, the author or authors of this software dedicate any and all copyright interest in the software to the public domain. We make this dedication for the benefit of the public at large and to the detriment of our heirs and successors. We intend this dedication to be an overt act of relinquishment in perpetuity of all present and future rights to this software under copyright law.</p>
<p>THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.</p>
<p>For more information, please refer to <a href="http://unlicense.org.">http://unlicense.org.</a> </p>
<h2><a class="anchor" id="main-intro"></a>
Introduction</h2>
<p>SithTemplate is a flexible and extensible PHP templating engine, inspired primarily by Django.</p>
<p>This is documentation for 1.1 line of the library, which obsoletes older 0.1-1.0 line.</p>
<p><b> This project is no longer in development. Bugfixes may be provided, but no further releases will be made. </b></p>
<h3><a class="anchor" id="main-intro-why"></a>
Why should I try?</h3>
<p>SithTemplate has number of useful features, so I think you should at least try it, if you're looking for a template engine for PHP.</p>
<ul>
<li>
SithTemplate is <b>small</b> - library itself is about ~80kB of code, ~1000 SLOC (without comments) in 12 classes (in 10 files), and standard library is single ~45kB plugin file, ~900 SLOC (without comments) [measure based on Mercurial head, as of 10-08-2009].  </li>
<li>
SithTemplate has relatively <b>small overhead</b> - as library tries to shift the overhead from runtime part to the compiler, it has low memory usage. As for speed - it may not be the fastest one available (especially since it [ab]uses slowish PHP object system - no other engine I know generates PHP classes for templates) but it's not the slowest one either - speed overhead is (IMHO at least) reasonable and pretty stable (especially for repeated template rendering). And it's opcode-cache friendly.  </li>
<li>
SithTemplate is <b>free</b> and <b>open-source</b>, with very permissive licensing - used <b>New BSD License</b> allows it to be included in both free and commercial, open- and closed-source projects.  </li>
<li>
SithTemplate is <b>generic</b>, and can process any kind of plain text, not only (X)HTML, like some engines. Web layouts, e-mails, code, configuration files, anything is possible.  </li>
<li>
SithTemplate is <b>extensible</b> - if included I/O drivers or tags/filters are not enough for your project, you can easily add your own.  </li>
<li>
SithTemplate has an <b>easy API</b> - create one object, call one method and your template output is ready to be displayed. It also has a <b>simple, plain-text syntax</b>, based on Django. No XML writing required, ever!  </li>
<li>
SithTemplate supports a <b>multi-zoned template inheritance</b> - feature ported from Django (Python web framework) that together with simple syntax makes templates more clear and maintainable, and hierarchical ones feel more natural (than using e.g. header/footer inclusion in every template).  </li>
<li>
SithTemplate is <b>Unicode-aware</b>. It uses mbstring routines exclusively, both in the core and in the standard library, instead of the core PHP string manipulation functions. It introduces additional dependency, and maybe even slight performance degradation, but it also makes library safer when UTF-8-encoded data is manipulated. And standard filters are shorter and locale-independent (like <code>lower</code>).  </li>
<li>
SithTemplate has been <b>tested in production</b>, and while internals and API has changed in 1.1, established concepts and template syntax are the same. Library is also tested by an automated unit test suite, with over 200 test cases, which keeps old bugs from reappearing. It is tested on three different PHP versions before releasing, ensuring that it will work without compatibility problems on all supported configurations.  </li>
<li>
SithTemplate tries to stay <b>compatible with Django</b>, and while it introduces its own extensions to the standard library, there are just slight differences in the syntax (the most significant is in the variable access). So if you know Django, then you will have little or no problems using SithTemplate. Also most of the Django's standard tags and filters are implemented in the current version of the library.  </li>
</ul>
<h3><a class="anchor" id="main-intro-req"></a>
Requirements</h3>
<p>SithTemplate requires PHP5 (at least 5.1, but 5.2 is recommended) with SPL and mbstring enabled.</p>
<p>PHP versions 5.0 and 6.x are not supported. The library is tested with PHPUnit tests on PHP 5.1, 5.2 and 5.3 before releasing.</p>
<p>Test suite also requires PHPUnit 3.2.</p>
<p>Runtime part of the library requires at least ~200kB of free RAM in simplest cases, and the compiler requires at least 1MB.</p>
<h2><a class="anchor" id="main-tutorial"></a>
Tutorial</h2>
<p>If you want to try SithTemplate, follow tutorial on page <a class="el" href="tutorial.html">SithTemplate tutorial</a> to get yourself familiar with library's concepts and usage.</p>
<h2><a class="anchor" id="main-stdlib"></a>
Standard library reference</h2>
<p>See <a class="el" href="stdlib.html">Standard library</a> page for reference on standard tags and filters.</p>
<h2><a class="anchor" id="main-extending"></a>
Extending SithTemplate</h2>
<p>If you're interested in extending library's capabilities, see <a class="el" href="extending-st.html">Extending SithTemplate</a> page.</p>
<h2><a class="anchor" id="main-bugs"></a>
Reporting bugs, getting support</h2>
<p>You're encouraged to file all found bugs to the project's <a href="http://bitbucket.org/piotrlegnica/sithtemplate/issues/">bugtracker</a>, even if you're not sure whether it's library's bug, or just your mistake.</p>
<p>Remember to use English in both cases. </p>
</div>
<hr class="footer"/><address class="footer"><small>Generated on Fri Jan 14 2011 20:08:36 for SithTemplate by&#160;
<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.7.2 </small></address>
</body>
</html>
Return current item: SithTemplate