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

Get Smart Use Smarty

on

  • 5,188 views

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.

Statistics

Views

Total Views
5,188
Views on SlideShare
5,182
Embed Views
6

Actions

Likes
2
Downloads
0
Comments
0

1 Embed 6

http://www.slideshare.net 6

Accessibility

Categories

Upload Details

Uploaded via as Microsoft PowerPoint

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment

Get Smart Use Smarty Get Smart Use Smarty Presentation Transcript

  • Get Smart Use Smarty Michael Bourque Boston PHP May 6, 2009
  • 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
  • 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
  • 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…
  • Have you ever done this?
  • Have you ever had to work on this?
  • MVC
    • Model
    • View
    • Controller
  •  
  • Controller Controller View View Model
  • Easier to maintain this!
  • Controller View Model Business Logic Data layer Flow control Presentation
  • 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;
  • Get Smart : Usage
    • Basic syntax
  • 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}
  • Get Smart : Tips
    • Loops
    • Config Files
    • Sending emails
    • Escaping
    • Caching
    • Debugging
  • Get Smart : Demo
    • Get Smarty Demo
    • Language files
    • Sending emails
    • Progressive Enhancement
    • jQuery
  • Q/A
  • Thank you…
    • Contact me
    • [email_address]