Smarty PHP Template Programming and Applications
  FREE ONLINE EDITION: Read full chapters online, download free samples from the book and more...
  Index > Chapter 10
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 10: Extending Smarty with Plug-ins

While Smarty was made to contain functions relevant to most common web development needs, there are times when you need to extend it. There are also some cases in which developing a Smarty plug-in is a good idea, because it might save you time or it might make sense to centralize a particular type of functionality into a single function call.

In this chapter, we will go over the process of finding, installing, and using plug-ins in templates, and also give an overview of how to implement your own custom functionality.

Smarty defines a plug-in as any type of custom functionality implemented by third-party developers. Smarty is already distributed with a wide variety of functions, and while some of them are needed by Smarty itself (called built‑in functions), others can be changed to define some extra functionality (called custom functions). Plug-ins, however, are usually associated with totally different functionality not available by default in Smarty.

  • Chapter 10: Extending Smarty with Plug-ins
    • Finding and Installing Plug-ins
    • Useful Plug-ins
      • HTML List Plug-in
      • File Size Format Plug-in
      • Google Highlight Plug-in
    • Writing your own Plug-ins
    • Plug-in Types
      • Functions
      • Modifiers
      • Block Functions
      • Compiler Functions
      • Prefilters, Postfilters, and Output Filters
      • Resources
      • Inserts
    • Registering Plug-ins
    • Example Plug-in: Calendar
    • Example Plug-in: Auto-link URLs
    • Summary

 

 

 

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