• Like
  • Save
Get Smart Use Smarty
Upcoming SlideShare
Loading in...5

Get Smart Use Smarty

Uploaded on

Although Smarty is known as a "Template Engine", it would be more accurately described as a "Template/Presentation Framework." That is, it provides the programmer and template designer with a wealth …

Although Smarty is known as a "Template Engine", it would be more accurately described as a "Template/Presentation Framework." That is, it provides the programmer and template designer with a wealth of tools to automate tasks commonly dealt with at the presentation layer of an application. I stress the word Framework because Smarty is not a simple tag-replacing template engine. Although it can be used for such a simple purpose, its focus is on quick and painless development and deployment of your application, while maintaining high-performance, scalability, security and future growth.

Join BostonPHP and Michael Bourque as he takes you through the Smarty Framework. This will be an interactive session where Michael will write code and demonstrate throughout the session. You will leave with the tools and information to apply Smarty to your next project:

What is Smarty? Learn why it is good to separate the presentation code from the business logic of your application

* Smarty syntax and functions
* Best practices and demos
* How to use a terminology property file to make it easier to control application terminology and software strings outside of your code.
* Learn how to offer multiple language support and switching in your application
* Plenty of time for your questions and answers

See why so many others love using Smarty in their projects. You will too and I will show you how. Invite your PHP friends, your CSS/Design team - you don't want to miss this one.

More in: Technology
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Be the first to comment
No Downloads


Total Views
On Slideshare
From Embeds
Number of Embeds



Embeds 0

No embeds

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

    No notes for slide


  • 1. Get Smart Use Smarty Michael Bourque Boston PHP May 6, 2009
  • 2. What I hope to cover
    • Why Smarty?
    • Installation
    • Smarty syntax overview
    • Some examples and demos
    • L10n & I18n (AKA Localization)
    • Cool effects to add to your web app
    • Q & A
  • 3. What’s so smart about smarty?
    • Separate view from business logic
      • If your not already using an MVC framework
    • Designers cant break the business code
    • Easy to read / Easy to use
    • Useful built in functions and modifiers
    • Optional content caching
    • Configuration files
  • 4. What’s not smart about smarty?
    • What critics say…
    • Performance
      • Nothing is faster than PHP
    • Security Claim
      • No extra security
    • Better templating solutions
    • Debugging is better with Firebug / FirePHP
    • etc…
  • 5. Have you ever done this?
  • 6. Have you ever had to work on this?
  • 7. MVC
    • Model
    • View
    • Controller
  • 8.  
  • 9. Controller Controller View View Model
  • 10. Easier to maintain this!
  • 11. Controller View Model Business Logic Data layer Flow control Presentation
  • 12. Get Smart : Installation
    • Download it from smarty.net, Subversion, or Pear:
      • pear channel-discover pear-smarty.googlecode.com/svn
      • pear install smarty/smarty
    • Create cache and template folders
      • cache
      • templates_c
    • Include it
      • include('Smarty.class.php');
      • $smarty = new Smarty;
  • 13. Get Smart : Usage
    • Basic syntax
  • 14. Get Smart : Examples
    • Comments
      • {* this is a comment *}
    • Variables
      • {$variable}, {$array[4]}, {$array.key.key}, $object->property}
    • Functions
      • {config_load file=}, {include file=}, {if}{else}{/if}, {foreach}
    • Modifiers
      • {$date|date_format}, {$title|truncate:40:'...'}
    • $smarty
      • {$smarty.get.page}, {$smarty.cookies.username}, {$smarty.request.username}
  • 15. Get Smart : Tips
    • Loops
    • Config Files
    • Sending emails
    • Escaping
    • Caching
    • Debugging
  • 16. Get Smart : Demo
    • Get Smarty Demo
    • Language files
    • Sending emails
    • Progressive Enhancement
    • jQuery
  • 17. Q/A
  • 18. Thank you…
    • Contact me
    • [email_address]