The Savant Template System for PHP

The simple, elegant, and powerful alternative to Smarty.

  Savant2 (2.4.3)   Documentation   Contributed Classes   Other Information  
  Documentation   Getting Started   API Reference   Template Plugins   Output Filters   Error Handlers   Markup Compilers  

Savant Versions:

Savant2

Savant3


Please help support Savant; you can donate, or click on a sponsor.

Amazon Honor System Click Here to Pay Learn More

Template Plugins

To use a plugin in a template script, call it using $this->plugin() or $this->splugin(). The first parameter is always the name of the plugin (such as 'stylesheet' or 'options', and the remaining parameters depend on the specific plugin.

Note: As of Savant 2.3.1 and later, you can use the the plugin name as the method name instead of the plugin() method. For example, instead of $this->plugin('ahref', ...) you can use $this->ahref(...). However, this only works in PHP5.

Savant is packaged with 13 default plugins in the Savant2/ directory:

  • General Purpose
    • cycle to cycle through a list of values
    • dateformat to format date and time strings
    • modify to apply a series of functions to a value
  • XHTML Tags
    • ahref to create an <a href="..."></a> tag
    • image to place an <img /> tag
    • javascript to create a <script src="..."></script> tag
    • stylesheet to generate a <link /> tag linking to a stylesheet
  • Simple XHTML Form Elements
    • checkbox for multiple <input type="checkbox" /> elements
    • input for single <input /> elements
    • options for a series of <option /> elements
    • radios for a series of <input type="radio" /> elements
    • textarea for a <textarea></textarea> element
  • Entire XHTML Forms
    • form to automate form creation, layout, and feedback messages
Savant2:PluginRef (pmjones)
Mon Dec 13 12:33:18 2004
[ Links | Source | History | RSS ]

This site powered by YaWiki 0.22 beta.

Copyright © 2003-2010, Paul M. Jones.


jason [AT] turbowebs [DOT] com
2006-04-12 14:37:07 (1098)
I can't find anywhere to ask for help but here, so here goes. The plugin classes are not working for me at all. I can't figure out the problem. Here's the error: Warning: main(Savant2/Plugin.php): failed to open stream: No such file or directory in /var/www/html/usa/include/Savant2/Savant2_Plugin_stylesheet.php on line 6 The wierdest thing is that the file it is trying to open does exist and is located exactly where it is trying to look. Any Help? Thanks,

New comments are disabled.

Template Plugins
ahref
checkbox
cycle
dateformat
form
image
input
javascript
modify
options
radios
stylesheet
textarea