Have an account? Sign in
Login  Register  Facebook
Smarty 3 and the new features

What's New

The Smarty 3 code base is a 100% rewrite, and contains many language features that do not exist in PHP 4. This means Smarty 3 will NOT work with PHP 4. If you need PHP 4 support, you will have to stick with Smarty 2 until you can upgrade PHP.

Important Changes

  • "{" and "}" (Javascript) Auto-Escapement - Smarty 2, you had to escape occurances of {} characters by surrounding them with {literal}{/literal} blocks or replacing them with {ldelim}{rdelim} tags. With Smarty 3, the braces will be ignored so long as they are surrounded by white space.
  • In-Template Function Definitions - You can create functions within a template and call them just like a plugin function. When you have a plugin that generates presentational content, keeping it in the template is often a more manageable choice. It also simplifies data traversal, such as deeply nested menus.
Go to "Smarty 3 Overview" too see all

Backward-Compatibility with Smarty 2

Much of Smarty 3 is backward compatible with Smarty 2, except for the items noted in the SMARTY2 notes file included with the Smarty 3 distribution. Please see that file for a detail breakdown of BC differences.
Subscribe and get the newest free resources
September 22, 2011 Smarty