What is Smarty and how does it work?
Smarty is a template engine for PHP. More specifically, it facilitates a manageable way to separate application logic and content from its presentation. This is best described in a situation where the application programmer and the template designer play different roles, or in most cases are not the same person.
If you're not familiar with Smarty, you should read the crash course before you start editing AWF templates.
Detailed documentation is available on the smarty homepage.
Some of Smarty's features:
- It is extremely fast.
- It is efficient since the PHP parser does the dirty work.
- No template parsing overhead, only compiles once.
- It is smart about recompiling only the template files that have changed.
- You can make custom functions and custom variable modifiers, so the template language is extremely extensible.
- Configurable template delimiter tag syntax, so you can use {}, , <!--{}-->, etc.
- The if/elseif/else/endif constructs are passed to the PHP parser, so the {if ...} expression syntax can be as simple or as complex as you like.
- Unlimited nesting of sections, ifs, etc. allowed.
- It is possible to embed PHP code right in your template files, although this may not be needed (nor recommended) since the engine is so customizable.
- Built-in caching support
- Arbitrary template sources
- Custom cache handling functions
- Plugin architecture
Created: 08.01.2006 23:03 CET, Last Change: 21.01.2006 12:13 CET by admin





