Part III. Smarty For Programmers
Prev
Next
Part III. Smarty For Programmers
Table of Contents
11. Constants
SMARTY_DIR
12. Smarty Class Variables
$template_dir
$compile_dir
$config_dir
$plugins_dir
$debugging
$debug_tpl
$debugging_ctrl
$auto_literal
$autoload_filters
$compile_check
$force_compile
$caching
$cache_id
$cache_dir
$cache_lifetime
$cache_handler_func
$cache_modified_check
$config_overwrite
$config_booleanize
$config_read_hidden
$config_fix_newlines
$default_template_handler_func
$php_handling
$trusted_dir
$left_delimiter
$right_delimiter
$compiler_class
$request_vars_order
$request_use_auto_globals
$compile_id
$use_sub_dirs
$default_modifiers
$default_resource_type
13. Smarty Class Methods()
append()
— append an element to an assigned array
appendByRef()
— append values by reference
assign()
— assign variables/objects to the templates
assignByRef()
— assign values by reference
clearAllAssign()
— clears the values of all assigned variables
clearAllCache()
— clears the entire template cache
clearAssign()
— clears the value of an assigned variable
clearCache()
— clears the cache for a specific template
clearCompiledTemplate()
— clears the compiled version of the specified template resource
clearConfig()
— clears assigned config variables
compileAllConfig()
— compiles all known config files
compileAllTemplates()
— compiles all known templates
configLoad()
— loads config file data and assigns it to the template
createData()
— creates a data object
createTemplate()
— returns a template object
disableSecurity()
— disables template security
display()
— displays the template
enableSecurity()
— enables template security
fetch()
— returns the template output
getConfigVars()
— returns the given loaded config variable value
getRegisteredObject()
— returns a reference to a registered object
getTags()
— return tags used by template
getTemplateVars()
— returns assigned variable value(s)
isCached()
— returns true if there is a valid cache for this template
loadFilter()
— load a filter plugin
registerFilter()
— dynamically register filters
registerPlugin()
— dynamically register plugins
registerObject()
— register an object for use in the templates
registerResource()
— dynamically register resources
templateExists()
— checks whether the specified template exists
unregisterFilter()
— dynamically unregister a filter
unregisterPlugin
— dynamically unregister plugins
unregisterObject()
— dynamically unregister an object
unregisterResource()
— dynamically unregister a resource plugin
testInstall()
— checks Smarty installation
14. Caching
Setting Up Caching
Multiple Caches Per Page
Cache Groups
Controlling Cacheability of Plugins' Output
15. Advanced Features
Security
Changing settings by template
Template Inheritance
Streams
Objects
Static Classes
Prefilters
Postfilters
Output Filters
Cache Handler Function
Resources
Templates from $template_dir
Templates from any directory
Templates from strings
Template inheritance defined by PHP script
Templates from other sources
Default template handler function
16. Extending Smarty With Plugins
How Plugins Work
Naming Conventions
Writing Plugins
Template Functions
Modifiers
Block Functions
Compiler Functions
Prefilters/Postfilters
Output Filters
Resources
Inserts