What
Is Smarty?
Smarty is a is PHP template engine with an extensible architecture,
built-in template compiling, and optional output caching.
The project was started in late 2000 by Monte Ohrt and Andrei Zmievski,
and was the result of a failed attempt at writing an all-purpose
template extension for PHP in C. They decided to start from scratch and
rewrite it as a PHP class.
Recent development has been done by Monte and Messju Mohr, and involved
adding object support, optimizing the compiler, and enhancing custom
function support.
Code and notes in this presentation apply to version 2.6, at RC1 as of
August 11, 2003.
So What Does It Look Like?
Here is a
hello world example.
Three Tasks Shortcut:
- Process posted vars and display a form.
- Display the results of a MySQL query.
- Display a directory listing with
image
thumbnails and human-readable filesizes.