O'Reilly logo

Learning PHP, MySQL, and JavaScript by Robin Nixon

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Why Smarty?

The Smarty templating system is probably the best known and most used on the Internet. It provides the following benefits:

  • Designers can’t break application code. They can modify the templates all they want, but the code stays intact. Consequently the code is tighter, more secure, and easier to maintain.

  • Errors in the templates are confined to Smarty’s error-handling routines, making them simple and intuitive to deal with.

  • With presentation in its own layer, designers can modify or completely redesign a web layout from scratch—all without intervention from the programmer.

  • Programmers can go about maintaining the application code, changing the way content is acquired, and so on, without disturbing the presentation layer.

  • Templates are a close representation of what the final output will be, which is an intuitive approach.

  • Smarty has many security features built in so that designers won’t breach security and you won’t open your server to the execution of arbitrary PHP code.

But separating the application code from the presentation layer doesn’t mean that the logic is also separated, because Smarty offers comprehensive presentation logic features, too, as you’ll see later.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required