Overview

Packages

  • akismet
  • None
  • PHP
  • Smarty
    • Cacher
    • Compiler
    • Config
    • Debug
    • plugins
    • PluginsBlock
    • PluginsFilter
    • PluginsFunction
    • PluginsInternal
    • PluginsModifier
    • PluginsModifierCompiler
    • PluginsShared
    • Security
    • Template
    • TemplateResources
  • Swift
    • ByteStream
    • CharacterStream
    • Encoder
    • Events
    • KeyCache
    • Mailer
    • Mime
    • Plugins
    • Signatures
    • Signed
    • Transport
  • wa-apps
    • blog
      • actions
        • backend
        • blog
        • comment
        • cron
        • design
        • frontend
        • page
        • plugin
        • post
      • api
        • v1
      • cli
      • layout
      • model
      • plugin
        • aksimet
        • category
        • emailsubscription
        • favorite
        • gravatar
        • import
        • markdown
        • myposts
        • tag
        • troll
      • settings
    • checklists
      • backend
      • json
    • contacts
      • backend
    • developer
    • dummy
    • guestbook
    • guestbook2
    • photos
      • album
      • api
        • v1
      • backend
      • design
      • dialog
      • frontend
      • page
      • photo
      • plugin
        • comment
        • imageeffects
        • import
        • publicgallery
        • watermark
      • search
      • settings
      • stack
      • tag
      • upload
    • site
      • backend
      • blocks
      • config
      • design
      • domains
      • files
      • frontend
      • helper
      • layout
      • pages
      • routing
      • setting
    • stickies
      • api
        • v1
      • sheet
      • stiky
  • wa-plugin
    • payment
    • shipping
    • sms
  • wa-plugins
    • shipping
      • usps
  • wa-system
    • API
    • Auth
      • Adapters
    • Autoload
    • Cache
      • Adapter
    • Captcha
    • Config
    • Contact
    • controller
    • currency
    • database
    • datetime
    • design
    • event
    • exception
    • files
    • image
    • layout
    • locale
    • log
    • mail
    • page
      • action
      • model
    • payment
    • plugin
    • request
    • response
    • routing
    • shipping
    • sms
    • storage
    • user
    • util
    • validator
    • view
    • webasyst
      • api
      • backend
      • cli
      • config
      • layout
      • login
      • model
      • password
      • payment
      • profile
      • settings
      • shipment
    • widget
    • workflow
  • waPlugins
    • Payment
  • webasyst
    • wa-system
      • helper

Classes

  • Smarty

Exceptions

  • SmartyCompilerException
  • SmartyException

Functions

  • smartyAutoload
  • Overview
  • Package
  • Class
  • Tree
  • Deprecated
  • Todo

Class Smarty

This is the main Smarty class

Smarty_Internal_Data
Extended by Smarty_Internal_TemplateBase
Extended by Smarty
Package: Smarty
Copyright: 2008 New Digital Group, Inc.
Author: Monte Ohrt <monte at ohrt dot com>
Author: Uwe Tews
Author: Rodney Rehm
Located at wa-system/vendors/smarty3/Smarty.class.php
Methods summary
public
# __construct( )

Initialize new Smarty object

Initialize new Smarty object

public
# __destruct( )

Class destructor

Class destructor

public
# __clone( )

<<magic>> set selfpointer on cloned object

<<magic>> set selfpointer on cloned object

public mixed
# __get( string $name )

<<magic>> Generic getter.

<<magic>> Generic getter.

Calls the appropriate getter function. Issues an E_USER_NOTICE if no valid getter is found.

Parameters

$name
string
$name property name

Returns

mixed
public
# __set( string $name, mixed $value )

<<magic>> Generic setter.

<<magic>> Generic setter.

Calls the appropriate setter function. Issues an E_USER_NOTICE if no valid setter is found.

Parameters

$name
string
$name property name
$value
mixed
$value parameter passed to setter
public boolean
# templateExists( string $resource_name )

Check if a template resource exists

Check if a template resource exists

Parameters

$resource_name
string
$resource_name template name

Returns

boolean
status
public string
# getGlobal( object $varname = null )

Returns a single or all global variables

Returns a single or all global variables

Parameters

$varname
object
$smarty

Returns

string
variable value or or array of variables
public integer
# clearAllCache( integer $exp_time = null, string $type = null )

Empty cache folder

Empty cache folder

Parameters

$exp_time
integer
$exp_time expiration time
$type
string
$type resource type

Returns

integer
number of cache files deleted
public integer
# clearCache( string $template_name, string $cache_id = null, string $compile_id = null, integer $exp_time = null, string $type = null )

Empty cache for a specific template

Empty cache for a specific template

Parameters

$template_name
string
$template_name template name
$cache_id
string
$cache_id cache id
$compile_id
string
$compile_id compile id
$exp_time
integer
$exp_time expiration time
$type
string
$type resource type

Returns

integer
number of cache files deleted
public Smarty
# enableSecurity( string|Smarty_Security $security_class = null )

Loads security class and enables security

Loads security class and enables security

Parameters

$security_class
string|Smarty_Security
$security_class if a string is used, it must be class-name

Returns

Smarty
current Smarty instance for chaining

Throws

SmartyException
when an invalid class name is provided
public Smarty
# disableSecurity( )

Disable security

Disable security

Returns

Smarty
current Smarty instance for chaining
public Smarty
# setTemplateDir( string|array $template_dir )

Set template directory

Set template directory

Parameters

$template_dir
string|array
$template_dir directory(s) of template sources

Returns

Smarty
current Smarty instance for chaining
public Smarty
# addTemplateDir( string|array $template_dir, string $key = null )

Add template directory(s)

Add template directory(s)

Parameters

$template_dir
string|array
$template_dir directory(s) of template sources
$key
string
$key of the array element to assign the template dir to

Returns

Smarty
current Smarty instance for chaining

Throws

SmartyException
when the given template directory is not valid
public array|string
# getTemplateDir( mixed $index = null )

Get template directories

Get template directories

Parameters

$index
mixed
index of directory to get, null to get all

Returns

array|string
list of template directories, or directory of $index
public Smarty
# setConfigDir( string|array $config_dir )

Set config directory

Set config directory

Parameters

$config_dir
string|array
$template_dir directory(s) of configuration sources

Returns

Smarty
current Smarty instance for chaining
public Smarty
# addConfigDir( string|array $config_dir, string $key = null )

Add config directory(s)

Add config directory(s)

Parameters

$config_dir
string|array
$config_dir directory(s) of config sources
$key
string
key of the array element to assign the config dir to

Returns

Smarty
current Smarty instance for chaining
public array|string
# getConfigDir( mixed $index = null )

Get config directory

Get config directory

Parameters

$index
mixed
index of directory to get, null to get all

Returns

array|string
configuration directory
public Smarty
# setPluginsDir( string|array $plugins_dir )

Set plugins directory

Set plugins directory

Parameters

$plugins_dir
string|array
$plugins_dir directory(s) of plugins

Returns

Smarty
current Smarty instance for chaining
public Smarty
# addPluginsDir( object $plugins_dir )

Adds directory of plugin files

Adds directory of plugin files

Parameters

$plugins_dir
object
$smarty

Returns

Smarty
current Smarty instance for chaining
public array
# getPluginsDir( )

Get plugin directories

Get plugin directories

Returns

array
list of plugin directories
public Smarty
# setCompileDir( string $compile_dir )

Set compile directory

Set compile directory

Parameters

$compile_dir
string
$compile_dir directory to store compiled templates in

Returns

Smarty
current Smarty instance for chaining
public string
# getCompileDir( )

Get compiled directory

Get compiled directory

Returns

string
path to compiled templates
public Smarty
# setCacheDir( string $cache_dir )

Set cache directory

Set cache directory

Parameters

$cache_dir
string
$cache_dir directory to store cached templates in

Returns

Smarty
current Smarty instance for chaining
public string
# getCacheDir( )

Get cache directory

Get cache directory

Returns

string
path of cache directory
public Smarty
# setDefaultModifiers( array|string $modifiers )

Set default modifiers

Set default modifiers

Parameters

$modifiers
array|string
$modifiers modifier or list of modifiers to set

Returns

Smarty
current Smarty instance for chaining
public Smarty
# addDefaultModifiers( array|string $modifiers )

Add default modifiers

Add default modifiers

Parameters

$modifiers
array|string
$modifiers modifier or list of modifiers to add

Returns

Smarty
current Smarty instance for chaining
public array
# getDefaultModifiers( )

Get default modifiers

Get default modifiers

Returns

array
list of default modifiers
public Smarty
# setAutoloadFilters( array $filters, string $type = null )

Set autoload filters

Set autoload filters

Parameters

$filters
array
$filters filters to load automatically
$type
string
$type "pre", "output", … specify the filter type to set. Defaults to none treating $filters' keys as the appropriate types

Returns

Smarty
current Smarty instance for chaining
public Smarty
# addAutoloadFilters( array $filters, string $type = null )

Add autoload filters

Add autoload filters

Parameters

$filters
array
$filters filters to load automatically
$type
string
$type "pre", "output", … specify the filter type to set. Defaults to none treating $filters' keys as the appropriate types

Returns

Smarty
current Smarty instance for chaining
public array
# getAutoloadFilters( string $type = null )

Get autoload filters

Get autoload filters

Parameters

$type
string
$type type of filter to get autoloads for. Defaults to all autoload filters

Returns

array
array( 'type1' => array( 'filter1', 'filter2', … ) ) or array( 'filter1', 'filter2', …) if $type was specified
public string
# getDebugTemplate( )

return name of debugging template

return name of debugging template

Returns

string
public Smarty
# setDebugTemplate( string $tpl_name )

set the debug template

set the debug template

Parameters

$tpl_name
string
$tpl_name

Returns

Smarty
current Smarty instance for chaining

Throws

SmartyException
if file is not readable
public object
# createTemplate( string $template, mixed $cache_id = null, mixed $compile_id = null, object $parent = null, boolean $do_clone = true )

creates a template object

creates a template object

Parameters

$template
string
$template the resource handle of the template file
$cache_id
mixed
$cache_id cache id to be used with this template
$compile_id
mixed
$compile_id compile id to be used with this template
$parent
object
$parent next higher level of Smarty variables
$do_clone
boolean
$do_clone flag is Smarty object shall be cloned

Returns

object
template object
public string
# loadPlugin( string $plugin_name, boolean $check = true )

Takes unknown classes and loads plugin files for them class name format: Smarty_PluginType_PluginName plugin filename format: plugintype.pluginname.php

Takes unknown classes and loads plugin files for them class name format: Smarty_PluginType_PluginName plugin filename format: plugintype.pluginname.php

Parameters

$plugin_name
string
$plugin_name class plugin name to load
$check
boolean
$check check if already loaded

Returns

string
|boolean filepath of loaded file or false
public integer
# compileAllTemplates( string $extension = '.tpl', boolean $force_compile = false, integer $time_limit = 0, integer $max_errors = null )

Compile all template files

Compile all template files

Parameters

$extension
string
$extension file extension
$force_compile
boolean
$force_compile force all to recompile
$time_limit
integer
$time_limit
$max_errors
integer
$max_errors

Returns

integer
number of template files recompiled
public integer
# compileAllConfig( string $extension = '.conf', boolean $force_compile = false, integer $time_limit = 0, integer $max_errors = null )

Compile all config files

Compile all config files

Parameters

$extension
string
$extension file extension
$force_compile
boolean
$force_compile force all to recompile
$time_limit
integer
$time_limit
$max_errors
integer
$max_errors

Returns

integer
number of template files recompiled
public integer
# clearCompiledTemplate( string $resource_name = null, string $compile_id = null, integer $exp_time = null )

Delete compiled template file

Delete compiled template file

Parameters

$resource_name
string
$resource_name template name
$compile_id
string
$compile_id compile id
$exp_time
integer
$exp_time expiration time

Returns

integer
number of template files deleted
public array
# getTags( Smarty_Internal_Template $template )

Return array of tag/attributes of all tags used by an template

Return array of tag/attributes of all tags used by an template

Parameters

$template
object
$templae template object

Returns

array
of tag/attributes
public boolean
# testInstall( array & $errors = null )

Run installation test

Run installation test

Parameters

$errors
array
$errors Array to write errors into, rather than outputting them

Returns

boolean
true if setup is fine, false if something is wrong
public static boolean
# mutingErrorHandler( integer $errno, mixed $errstr, mixed $errfile, mixed $errline, mixed $errcontext )

Error Handler to mute expected messages

Error Handler to mute expected messages

Parameters

$errno
integer
$errno Error level
$errstr
$errfile
$errline
$errcontext

Returns

boolean

Link

http://php.net/set_error_handler
public static
# muteExpectedErrors( )

Enable error handler to mute expected messages

Enable error handler to mute expected messages

public static
# unmuteExpectedErrors( )

Disable error handler muting expected messages

Disable error handler muting expected messages

Methods inherited from Smarty_Internal_TemplateBase
__call(), _get_filter_name(), createData(), display(), fetch(), getRegisteredObject(), isCached(), loadFilter(), registerCacheResource(), registerClass(), registerDefaultConfigHandler(), registerDefaultPluginHandler(), registerDefaultTemplateHandler(), registerFilter(), registerObject(), registerPlugin(), registerResource(), unloadFilter(), unregisterCacheResource(), unregisterFilter(), unregisterObject(), unregisterPlugin(), unregisterResource()
Methods inherited from Smarty_Internal_Data
append(), appendByRef(), assign(), assignByRef(), assignGlobal(), clearAllAssign(), clearAssign(), clearConfig(), configLoad(), getConfigVariable(), getConfigVars(), getStreamVariable(), getTemplateVars(), getVariable()
Constants summary
string SMARTY_VERSION 'Smarty-3.1.14'
#

smarty version

smarty version

integer SCOPE_LOCAL 0
#

define variable scopes

define variable scopes

integer SCOPE_PARENT 1
#
integer SCOPE_ROOT 2
#
integer SCOPE_GLOBAL 3
#
integer CACHING_OFF 0
#

define caching modes

define caching modes

integer CACHING_LIFETIME_CURRENT 1
#
integer CACHING_LIFETIME_SAVED 2
#
integer CLEAR_EXPIRED -1
#

define constant for clearing cache files be saved expiration datees

define constant for clearing cache files be saved expiration datees

integer COMPILECHECK_OFF 0
#

define compile check modes

define compile check modes

integer COMPILECHECK_ON 1
#
integer COMPILECHECK_CACHEMISS 2
#
integer PHP_PASSTHRU 0
#

modes for handling of "<?php ... ?>" tags in templates.

modes for handling of "<?php ... ?>" tags in templates.

integer PHP_QUOTE 1
#
integer PHP_REMOVE 2
#
integer PHP_ALLOW 3
#
string FILTER_POST 'post'
#

filter types

filter types

string FILTER_PRE 'pre'
#
string FILTER_OUTPUT 'output'
#
string FILTER_VARIABLE 'variable'
#
string PLUGIN_FUNCTION 'function'
#

plugin types

plugin types

string PLUGIN_BLOCK 'block'
#
string PLUGIN_COMPILER 'compiler'
#
string PLUGIN_MODIFIER 'modifier'
#
string PLUGIN_MODIFIERCOMPILER 'modifiercompiler'
#
Properties summary
public static array $global_tpl_vars array()
#

assigned global tpl vars

assigned global tpl vars

public static mixed $_previous_error_handler null
#

error handler returned by set_error_hanlder() in Smarty::muteExpectedErrors()

error handler returned by set_error_hanlder() in Smarty::muteExpectedErrors()

public static array $_muted_directories array()
#

contains directories outside of SMARTY_DIR that are to be muted by muteExpectedErrors()

contains directories outside of SMARTY_DIR that are to be muted by muteExpectedErrors()

public static mixed $_MBSTRING SMARTY_MBSTRING
#

Flag denoting if Multibyte String functions are available

Flag denoting if Multibyte String functions are available

public static mixed $_CHARSET SMARTY_RESOURCE_CHAR_SET
#

The character set to adhere to (e.g. "UTF-8")

The character set to adhere to (e.g. "UTF-8")

public static mixed $_DATE_FORMAT SMARTY_RESOURCE_DATE_FORMAT
#

The date format to be used internally (accepts date() and strftime())

The date format to be used internally (accepts date() and strftime())

public static string $_UTF8_MODIFIER 'u'
#

Flag denoting if PCRE should run in UTF-8 mode

Flag denoting if PCRE should run in UTF-8 mode

public static boolean $_IS_WINDOWS false
#

Flag denoting if operating system is windows

Flag denoting if operating system is windows

public boolean $auto_literal true
#

auto literal on delimiters with whitspace

auto literal on delimiters with whitspace

public boolean $error_unassigned false
#

display error on not assigned variables

display error on not assigned variables

public boolean $use_include_path false
#

look up relative filepaths in include_path

look up relative filepaths in include_path

private array $template_dir array()
#

template directory

template directory

public string $joined_template_dir null
#

joined template directory string used in cache keys

joined template directory string used in cache keys

public string $joined_config_dir null
#

joined config directory string used in cache keys

joined config directory string used in cache keys

public callable $default_template_handler_func null
#

default template handler

default template handler

public callable $default_config_handler_func null
#

default config handler

default config handler

public callable $default_plugin_handler_func null
#

default plugin handler

default plugin handler

private string $compile_dir null
#

compile directory

compile directory

private array $plugins_dir array()
#

plugins directory

plugins directory

private string $cache_dir null
#

cache directory

cache directory

private array $config_dir array()
#

config directory

config directory

public boolean $force_compile false
#

force template compiling?

force template compiling?

public boolean $compile_check true
#

check template for modifications?

check template for modifications?

public boolean $use_sub_dirs false
#

use sub dirs for compiled/cached files?

use sub dirs for compiled/cached files?

public boolean $allow_ambiguous_resources false
#

allow ambiguous resources (that are made unique by the resource handler)

allow ambiguous resources (that are made unique by the resource handler)

public boolean $caching false
#

caching enabled

caching enabled

public boolean $merge_compiled_includes false
#

merge compiled includes

merge compiled includes

public integer $cache_lifetime 3600
#

cache lifetime in seconds

cache lifetime in seconds

public boolean $force_cache false
#

force cache file creation

force cache file creation

public string $cache_id null
#

Set this if you want different sets of cache files for the same templates.

Set this if you want different sets of cache files for the same templates.

public string $compile_id null
#

Set this if you want different sets of compiled files for the same templates.

Set this if you want different sets of compiled files for the same templates.

public string $left_delimiter "{"
#

template left-delimiter

template left-delimiter

public string $right_delimiter "}"
#

template right-delimiter

template right-delimiter

protected string $security_class 'Smarty_Security'
#

class name

class name

This should be instance of Smarty_Security.

See

Smarty_Security
protected Smarty_Security $_security_policy null
#

implementation of security class

implementation of security class

public integer $php_handling Smarty::PHP_PASSTHRU
#

controls handling of PHP-blocks

controls handling of PHP-blocks

public boolean $allow_php_templates false
#

controls if the php template file resource is allowed

controls if the php template file resource is allowed

public boolean $direct_access_security true
#

Should compiled-templates be prevented from being called directly?

Should compiled-templates be prevented from being called directly?

Currently used by Smarty_Internal_Template only. }

public boolean $debugging false
#

debug mode

debug mode

Setting this to true enables the debug-console.

public string $debugging_ctrl 'NONE'
#
This determines if debugging is enable-able from the browser.
  • NONE => no debugging control allowed
  • URL => enable debugging when SMARTY_DEBUG is found in the URL.
This determines if debugging is enable-able from the browser.
  • NONE => no debugging control allowed
  • URL => enable debugging when SMARTY_DEBUG is found in the URL.
public type $smarty_debug_id 'SMARTY_DEBUG'
#

Name of debugging URL-param.

Name of debugging URL-param.

Only used when $debugging_ctrl is set to 'URL'. The name of the URL-parameter that activates debugging.

public string $debug_tpl null
#

Path of debug template.

Path of debug template.

public integer $error_reporting null
#

When set, smarty uses this value as error_reporting-level.

When set, smarty uses this value as error_reporting-level.

public boolean $get_used_tags false
#

Internal flag for getTags()

Internal flag for getTags()

public boolean $config_overwrite true
#

Controls whether variables with the same name overwrite each other.

Controls whether variables with the same name overwrite each other.

public boolean $config_booleanize true
#

Controls whether config values of on/true/yes and off/false/no get converted to boolean.

Controls whether config values of on/true/yes and off/false/no get converted to boolean.

public boolean $config_read_hidden false
#

Controls whether hidden config sections/vars are read from the file.

Controls whether hidden config sections/vars are read from the file.

public boolean $compile_locking true
#

locking concurrent compiles

locking concurrent compiles

public boolean $cache_locking false
#

Controls whether cache resources should emply locking mechanism

Controls whether cache resources should emply locking mechanism

public float $locking_timeout 10
#

seconds to wait for acquiring a lock before ignoring the write lock

seconds to wait for acquiring a lock before ignoring the write lock

public array $template_functions array()
#

global template functions

global template functions

public string $default_resource_type 'file'
#

resource type used if none given

resource type used if none given

Must be an valid key of $registered_resources.

public string $caching_type 'file'
#

caching type

caching type

Must be an element of $cache_resource_types.

public array $properties array()
#

internal config properties

internal config properties

public string $default_config_type 'file'
#

config type

config type

public array $template_objects array()
#

cached template objects

cached template objects

public boolean $cache_modified_check false
#

check If-Modified-Since headers

check If-Modified-Since headers

public array $registered_plugins array()
#

registered plugins

registered plugins

public array $plugin_search_order array('function', 'block', 'compiler', 'class')
#

plugin search order

plugin search order

public array $registered_objects array()
#

registered objects

registered objects

public array $registered_classes array()
#

registered classes

registered classes

public array $registered_filters array()
#

registered filters

registered filters

public array $registered_resources array()
#

registered resources

registered resources

public array $_resource_handlers array()
#

resource handler cache

resource handler cache

public array $registered_cache_resources array()
#

registered cache resources

registered cache resources

public array $_cacheresource_handlers array()
#

cache resource handler cache

cache resource handler cache

public array $autoload_filters array()
#

autoload filter

autoload filter

public array $default_modifiers array()
#

default modifier

default modifier

public boolean $escape_html false
#

autoescape variable output

autoescape variable output

public static array $_smarty_vars array()
#

global internal smarty vars

global internal smarty vars

public integer $start_time 0
#

start time for execution time calculation

start time for execution time calculation

public integer $_file_perms 0644
#

default file permissions

default file permissions

public integer $_dir_perms 0771
#

default dir permissions

default dir permissions

public array $_tag_stack array()
#

block tag hierarchy

block tag hierarchy

public Smarty $smarty
#

self pointer to Smarty object

self pointer to Smarty object

public string $_current_file null
#

required by the compiler for BC

required by the compiler for BC

public boolean $_parserdebug false
#

internal flag to enable parser debugging

internal flag to enable parser debugging

public array $merged_templates_func array()
#

Saved parameter of merged templates during compilation

Saved parameter of merged templates during compilation

Properties inherited from Smarty_Internal_Data
$config_vars, $parent, $template_class, $tpl_vars
My fork of Webasyst Framework API documentation generated by ApiGen 2.8.0