Smarty PHP Template Programming and Applications
  FREE ONLINE EDITION: Read full chapters online, download free samples from the book and more...
  Index > Chapter 6
Book Contents

Preface
Chapter 1: Introduction to Smarty
Chapter 2: Smarty Site Architecture
Chapter 3: What Designers Need to Know
Chapter 4: Creating a Template
Chapter 5: Advanced Templating
Chapter 6: Smarty Functions
Chapter 7: Debugging for Designers
Chapter 8: Built-in Smarty Variables and Methods
Chapter 9: Caching and Performance
Chapter 10: Extending Smarty with Plug-ins
Chapter 11: Filters
Chapter 12: Internationalization

Index

Free Content
Chapter 6: Smarty Functions[345 KB PDF]

Code Download

Download
Smarty Cheat Sheet


Download PDF Version [285 KB]

Download GIF Version [304 KB]
 

 

Chapter 6: Smarty Functions

Smarty provides a wide variety of functions available to you as a template designer to use as part of your templates. While you may never use some of these functions, it is important to get to know their functionality, as they were created with the ultimate goal of solving everyday problems of web developers.

As a rule of thumb, if you need some functionality in your templates and you don't know for sure if Smarty already provides it, check if there is already a function for it. If you require some custom functionality, consider writing a Smarty plug-in.

In this chapter you will learn about the different types of functions available in Smarty, a list of those functions and examples of their use, and how to extend Smarty and create your own functions. 

  • Chapter 6: Smarty Functions
    • Types of Smarty Functions
    • Functions in Action
      • Action: Re-using Page Elements with the include Function
      • Explanation
    • Inserting Dynamic Content
    • Passing Variables to Included Templates
    • Saving Variables in Configuration Files
    • Creating Configuration Sections for Each Page
    • Handling Lists in Templates
    • Removing Extra White Space from Templates
    • Handling JavaScript Code in Templates
    • Processing Deeply Nested Arrays
    • Cycling Through a List of Values
    • Avoiding Spam Indexers
    • Form-Related Functions
    • More Form-Related Functions
    • Summary

Read this chapter for free: Download Sample Chapter 6: Smarty Functions [345 KB PDF]

 

 

Paperback 250 pages
Released: April 2006
ISBN: 190481140X



eBook Version Also Available
Buy the book & eBook together and get 80% off the eBook

     

 




View the book details
on PacktPub.com

 


 

 

  This website is owned and maintained by Packt Publishing Ltd, 2006. All rights reserved. Terms and Conditions