O'Reilly logo

Wicked Cool PHP by Brian Ward, William Steinmetz

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

#7: Templating Your Site with Smarty

Most sites have a consistent look and feel. Although the dynamic content in the middle of the page may change, there's usually a header, a navigation bar on the side, and maybe an advertisement or two. There are simple ways to achieve this, from custom header-printing functions to include files. Depending on the size of your site, these solutions may work fine, but the larger and more complicated your content becomes, the more tedious making changes can get.

The most common templating solution is Smarty (http://smarty.php.net/). With Smarty, you create templates with variables. In other words, you can create one HTML file with placeholders for PHP-created data. In addition, you can include other Smarty templates ...

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