Location: PHPKode > projects > Open Power Template > docs/Opt/preface.html
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
   "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="pl">
<head>
	<meta http-equiv="content-type" content="text/html; charset=utf-8" />
	<meta name="robots" content="all" />

	<title>Preface - Open Power Template</title>
	
	<link rel="stylesheet" type="text/css" href="design/generic.css" media="all"  />
	<link rel="stylesheet" type="text/css" href="design/print.css" media="print" />
	<!--[if lte IE 6]><link rel="stylesheet" href="design/ie.css" type="text/css" /><![endif]-->	
	<!--[if IE 7]><link rel="stylesheet" href="design/ie7.css" type="text/css" /><![endif]-->
</head>
<body>

<div id="wrap">
	<div id="header">
		<h1>Open Power Template 2.0</h1>
		<h2>Preface</h2>
		<p class="generated">@ 02.09.2010</p>
		<p class="location"><a href="index.html"><strong>User manual</strong></a> &raquo; <a href="preface.html">Preface</a></p>
	</div>
	
	<div id="content"><dl class="location"><dt><a href="index.html">Table of Contents</a><br/>1. Preface</dt><dd class="next">2. Installation<br/><a href="installation.html">Next &raquo;</a></dd></dl>	<h1>1. Preface</h1><p>The concept to separate presentation (XHTML code) and logic (scripts) layers has a long story. We can mix those two parts, use PHP itself to separate them or to manipulate the output document with DOM. There is also one more solution - template engines. The PHP script is accompanied by an additional file with a template which describes, how to display the data. A template engine is a system that puts the data generated by the script in the templates, thus generating the complete output for the user. The template does not have to be written in PHP, too. We can use a separate language there, because PHP code is too complex and too long for such tasks, even if it was being developed to deal with it. The new language uses very short and intuitive constructs that hide all the algorithmic issues away from the template designer, no matter whether he is familiar with programming or not. Moreover, the language can allow us to do things in the way that is impossible to achieve in PHP because of its structure.</p>

<h2>Open Power Template</h2>

<p>Open Power Template 2 is a successor of popular template engine for PHP5. We have redesigned it from scratch, because we wanted to continue our ideas and implement new functionality that was impossible to achieve on the old engine. The main source of new features and improvements are the users. Of course, we know that the code rewriting breaks the backward compatibility, but on the other hand we can now fix everything that worked or looked poorly. But in fact, the main project philosophy, goals and solutions are still present.</p>

<p>OPT can be described in two points: performance and the KISS rule (<em>Keep It Small and Simple</em>). We try to keep the simple operations simple and intuitive and to simplify more complex things. We always analyze existing projects and develop solutions to solve encountered problems easily. During the coding, we pay attention on the performance, optimizing the code as much as possible. OPT also means more than one way to work. We think that there is no the best model for all the tasks and we rather offer a set of tools which you can use, depending on your demands.</p>

<p>Open Power Template is a part of "Open Power Libs" project which is a set of supporting libraries for your scripts and frameworks. In order to work, it requires the core OPL files that are included in every OPT release.</p>

<h2>Features</h2>

<p>Some of the features offered by the new version:</p>

<ul>
<li>XML-based syntax with some simplifications, if the compatibility with the standards is not broken.</li>
<li>Support for XML and XHTML documents - the compiler checks the document syntax and reports all the errors.</li>
<li>Support for HTML - once we disable some strict options, OPT can be used with HTML code as well.</li>
<li>Quirks mode - for templates in non-XML format. This feature allows to support every text document.</li>
<li>Smart instruction set - all the necessary tools are included.</li>
<li>Declarative programming - you describe, what you want to have, not - how OPT is going to achieve the requested results. This simplifies the development process and shortens the learning curve.</li>
<li>Imperative programming constructs - just in case.</li>
<li>Advanced OOP support in templates - the library allows to use PHP objects and static classes in the templates.</li>
<li>Complete solutions for constructing the output from smaller pieces of code (modular templates).</li>
<li>Components - an excellent solution for HTML forms, but not only.</li>
<li>Multilingual website support.</li>
<li>The library can be extended directly or using plugins.</li>
<li>Objective and simple API.</li>
<li>HTTP header support.</li>
<li>gZip compression support.</li>
</ul>

<p>The feature list seems to be quite long, but everything is on the right place. All you have to do is to learn and use a couple of simple rules, and the rest is simple. The library is available under the terms of new BSD license.</p>

<h2>Documentation</h2>

<p>This document concerns the Open Power Template library only. It also contains the basic information on the OPL core, but more details can be found in its own documentation.</p>
<dl class="location location-bottom"><dt>1. Preface<br/><a href="index.html">Table of Contents</a></dt><dd class="next"><a href="installation.html">Next &raquo;</a><br/>2. Installation</dd></dl>		</div>
	
	<div id="footer">
		<p>Copyright &copy; <a href="http://www.invenzzia.org/">Invenzzia Group 2008-2009</a></p>
		<p>Available under the terms of license: <a href="http://www.gnu.org/licenses/fdl.html">GNU Free Documentation License 1.2</a></p>
		<p>Generated by <strong>TypeFriendly 0.1.4</strong> by <a href="http://www.invenzzia.org/">Invenzzia</a></p>
	</div>
</div>

</body>
</html>
Return current item: Open Power Template