|
|
crash RSS Feed
View JT's IsPopularOnLine RSS Feed
Smarty is a template engine for PHP. More specifically, which serves to separate application logic and content from its presentation. There are two advantages to using Smarty. First you can separate your backend database logic from the presentation logic. This makes for a much cleaner, more maintanable website. Secondly, using Smarty saves on Server resouces enabling your website to handle a heavier number of daily visitors to the site. Smarty will cache and buffer dynamically built webpages and serve the buffered copy. This reduces stress on your servers CPU and database because the database is queried only once, the Smarty page is built and saved to a file. For example, if you have a million visitors surphing the same webpage, the first visitor would build the page, the database would be queried and Smarty saves the copy to a file. The remaining million pageviews would be served from the static webpage from the saved file saving all of that database and computational overhead. Smarty cache time is configurable. When the cache expires the buffered copy is regenerated. You can also have multiple cached versions of a single page by passing a unique cache id to the display() function, check out the docs on that one!
For example, let's say you are creating a web page that is displaying a magazine article. The article headline, tagline, author and body are content elements, they contain no information about how they will be presented. They are passed into Smarty by the application, then the template designer edits the templates and uses a combination of HTML tags and template tags to format the presentation of these elements (HTML tables, background colors, font sizes, style sheets, etc.) One day the programmer needs to change the way the article content is retrieved (a change in application logic.) This change does not affect the template designer, the content will still arrive in the template exactly the same. Likewise, if the template designer wants to completely redesign the templates, this requires no changes to the application logic. Therefore, the programmer can make changes to the application logic without the need to restructure templates, and the template designer can make changes to templates without breaking application logic.
In your PHP application variables are assigned and a value is assigned to each variable for use in the Smarty template, then you display these values.
Follow this article to the Smarty Crash Course.
JTMcNaught
Super serves Specials at Amazon.com Everyday!
| 02/08/2007 11:47 AM |
| Smarty Crash Course to use Smarty Templates to improve performance of your PHP website. |
|
What is a Smarty? A SMARTY Crash Course... Smarty is a template engine for PHP. More specifically, which serves to separate application logic and content from its presentation. There are two advantages to using Smarty. First you can separate your backend database logic from the presentation logic. This makes for a much cleaner, more maintanable website. Secondly, using Smarty saves on Server resouces enabling your website to handle a heavier number of daily visitors to the site. Smarty ...
|
| 06/15/2007 07:38 PM |
| San Francisco Dentist |
|
Choose Bay SF Dental for your San Francisco cosmetic dentistry solutions, where Dr. Nancy Khalaf and her staff are committed to meeting your dental health needs with the care that will ensure good dental health and its many benefits. Proudly serving patients throughout the Richmond, Sunset and Ariza Vista Districts, the Presidio and the Laurel and Pacific Heights areas of San Francisco, including Burlingame and Colma, San Mateo, Marin, Mill Valley and South San Francisco.
Dr. Nancy Khalaf San Franciscos best dentist and ...
|
| 04/17/2007 12:44 AM |
| First Online Indian Real Estate Discussion Forum |
|
INDIAN REAL ESTATE FORUM First Online Indian Real Estate Discussion Forum Indian realty sector is immensely promising and most sought after for a wide variety of reasons. And the ...
|
| 04/20/2007 03:03 AM |
| AboutUs and IsPopularOnline.com - Community URL Internet Marketing |
|
About IsPopularOnline.com sign up here http://www.IsPopularOnline.com is a community URL marketing website developed by www.eBiz-IQ.com to help Little-guys get their affiliate products, services, mlm programs, ... (http://www.betterretirementsooner.com)
|
comments