Smarty Icon

You may use the Smarty logo according to the trademark notice.

Smarty Template Engine Smarty Template Engine

For sponsorship, advertising, news or other inquiries, contact us at:

Sites Using Smarty

Advertisement

Part III. Smarty For Programmers

Table of Contents

11. Charset Encoding
Charset Encoding
12. Constants
SMARTY_DIR
13. Smarty Class Variables
$allow_php_templates
$auto_literal
$autoload_filters
$cache_dir
$cache_id
$cache_lifetime
$cache_locking
$cache_modified_check
$caching
$caching_type
$compile_check
$compile_dir
$compile_id
$compile_locking
$compiler_class
$config_booleanize
$config_dir
$config_overwrite
$config_read_hidden
$debug_tpl
$debugging
$debugging_ctrl
$default_config_type
$default_modifiers
$default_resource_type
$default_config_handler_func
$default_template_handler_func
$direct_access_security
$error_reporting
$escape_html
$force_cache
$force_compile
$left_delimiter
$locking_timeout
$merge_compiled_includes
$php_handling
$plugins_dir
$right_delimiter
$smarty_debug_id
$template_dir
$trusted_dir
$use_include_path
$use_sub_dirs
14. Smarty Class Methods
addConfigDir() — add a directory to the list of directories where config files are stored
addPluginsDir() — add a directory to the list of directories where plugins are stored
addTemplateDir() — add a directory to the list of directories where templates are stored
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
getCacheDir() — return the directory where the rendered template's output is stored
getCompileDir() — returns the directory where compiled templates are stored
getConfigDir() — return the directory where config files are stored
getConfigVars() — returns the given loaded config variable value
getPluginsDir() — return the directory where plugins are stored
getRegisteredObject() — returns a reference to a registered object
getTags() — return tags used by template
getTemplateDir() — return the directory where templates are stored
getTemplateVars() — returns assigned variable value(s)
isCached() — returns true if there is a valid cache for this template
loadFilter() — load a filter plugin
Smarty::muteExpectedErrors() — mutes expected warnings and notices deliberately generated by Smarty
registerCacheResource() — dynamically register CacheResources
registerClass() — register a class for use in the templates
registerDefaultPluginHandler() — register a function which gets called on undefined tags
registerFilter() — dynamically register filters
registerPlugin() — dynamically register plugins
registerObject() — register an object for use in the templates
registerResource() — dynamically register resources
setCacheDir() — set the directory where the rendered template's output is stored
setCompileDir() — set the directory where compiled templates are stored
setConfigDir() — set the directories where config files are stored
setPluginsDir() — set the directories where plugins are stored
setTemplateDir() — set the directories where templates are stored
templateExists() — checks whether the specified template exists
unregisterCacheResource() — dynamically unregister a CacheResource plugin
unregisterFilter() — dynamically unregister a filter
unregisterPlugin — dynamically unregister plugins
unregisterObject() — dynamically unregister an object
unregisterResource() — dynamically unregister a resource plugin
testInstall() — checks Smarty installation
15. Caching
Setting Up Caching
Multiple Caches Per Page
Cache Groups
Controlling Cacheability of Output
Cacheability of Template Section
Cacheability of Tags
Cacheability of Variables
Cacheability of Plugins
Custom Cache Implementation
16. Resources
File Template Resources
Templates from $template_dir
Templates from a specific $template_dir
Templates from any directory
Windows Filepaths
String Template Resources
Stream Template Resources
Extends Template Resources
Custom Template Resources
17. Advanced Features
Security
Changing settings by template
Template Inheritance
Streams
Objects
Static Classes
Prefilters
Postfilters
Output Filters
18. Extending Smarty With Plugins
How Plugins Work
Naming Conventions
Writing Plugins
Template Functions
Modifiers
Block Functions
Compiler Functions
Prefilters/Postfilters
Output Filters
Resources
Inserts
19. SmartyBC - Backwards Compatibility Wrapper
SmartyBC class