• Home
  • Services
  • Writing Services
  • Join Joomla Club
  • Products
  • Request Quote
  • Blog
  • About Us
  • Contact Us
Jul

31

Smarty—The Ultimate Templating System for PHP

Filed Under (Smarty) by Ramin on 31-07-2009

Tagged Under : Smarty, Smarty—The Ultimate Templating System for PHP, Templating System for PHP

Now that we’ve decided to make our life easier by considering multi-tier architecture for our website, we should take a look at what Smarty can do, as well as what it can’t do for us.
Smarty is not built for separating HTML from PHP; instead, its primary goal is to separate the application logic from presentation logic. If Smarty’s goal was to separate PHP from HTML then the presentation layer would contain no logic; but Smarty templates can contain logic, as long as it is to be used for presentation only.
This may seem like it breaks the rules of rigid separation between layers and tasks, but there are good practical reasons for it. A simple example would be an e-commerce site with products displayed in four columns:

  • Without Smarty: If our presentation layer doesn’t contain logic, we need to modify the business logic to retrieve the products in four arrays.
  • With Smarty: Using logic in the templates, the programmer just passes the products to the templates in a single array and the designer arranges the products in the page as he or she desires.

Smarty offers an interface to pretty much all of PHP, so PHP can be included in the templates, but it’s recommended to leave most of PHP code at the business logic layer. Fortunately, Smarty’s logic is generally much simpler to use than PHP and designers do not need to become programmers in order to incorporate presentation logic into their Smarty designs.

0 Comments
Read More
  • Category

    • CMS (4)
    • Dot Net (4)
    • Joomla (3)
    • osCommerce (1)
    • Smarty (1)
    • Uncategorized (2)
    • Website design (1)
  • Services

    • Joomla Web Design and Development
    • Affordable Web Site Design
    • Joomla E-Commerce Websites
    • Custom Software Development
    • Shopping Cart Websites
    • Business Websites
    • Joomla Maintenance and Updates
    • Joomla Sites Redesign
    • PHP Web Development
    • .Net Development
    • Database Programming
    • Professional Joomla Templates
    • PSD to Joomla Template Conversion
    • Joomla Template Customization
    • Wordpress Template Customization
    • Hire Professional Joomla Developer
    • Hire PHP and MySql Developer
    • Hire Dedicated .Net Developer
    • Hire Database Designer
    • Wordpress Blog Design and Development
    • Create Shopping Cart by osCommerce
    • SQL Server2005 Reporting Service

    Writing Services

    • Website Content Writing and Editing
    • Keyword Articles
    • Sales Copy Writer
    • Hire a Blogger
    • Writing a Blog

    Our Products

    • Club Joomla Templates
    • Popular Joomla Extensions
    • Selling Freelancer Site Script
    • Free Joomla Templates
    • Free Joomla Extensions
    • Free Club Joomla Templates
    • Free Club Joomla Extensions

    Our Joomla Book Shop

    • Joomla Template Design
    • Building Websites with Joomla 1.5
    • Begining Ajax with PHP
    • Web Development, Asp.net Ajax
    • osCommerce: Professional Edition
    • Pro Drupal Development
    • Packt.Publishing.Drupal.5.Themes.Dec
    • Smarty PHP Template Programming
    • Wrox.Beginning.JavaScript.3rd.Edition.May
  • Archives

    • September 2009
    • July 2009
    • June 2009
    • May 2009
Joomla Web Design & Development | Shopping Cart Websites | Business Websites
© All Rights Reserved. Joomla Site 4ME