BlueSpice MediaWiki REL1_27
 All Classes Namespaces Files Functions Variables Groups Pages
Smarty Class Reference
Inheritance diagram for Smarty:
Collaboration diagram for Smarty:

Public Member Functions

 __construct ()
 
 templateExists ($resource_name)
 
 getGlobal ($varname=null)
 
 enableSecurity ($security_class=null)
 
 disableSecurity ()
 
 setTemplateDir ($template_dir, $isConfig=false)
 
 addTemplateDir ($template_dir, $key=null, $isConfig=false)
 
 getTemplateDir ($index=null, $isConfig=false)
 
 setConfigDir ($config_dir)
 
 addConfigDir ($config_dir, $key=null)
 
 getConfigDir ($index=null)
 
 setPluginsDir ($plugins_dir)
 
 addPluginsDir ($plugins_dir)
 
 getPluginsDir ()
 
 setCompileDir ($compile_dir)
 
 getCompileDir ()
 
 setCacheDir ($cache_dir)
 
 getCacheDir ()
 
 createTemplate ($template, $cache_id=null, $compile_id=null, $parent=null, $do_clone=true)
 
 loadPlugin ($plugin_name, $check=true)
 
 _getTemplateId ($template_name, $cache_id=null, $compile_id=null, $caching=null)
 
 _realpath ($path, $realpath=null)
 
 setCompileCheck ($compile_check)
 
 setUseSubDirs ($use_sub_dirs)
 
 setErrorReporting ($error_reporting)
 
 setEscapeHtml ($escape_html)
 
 setAutoLiteral ($auto_literal)
 
 setForceCompile ($force_compile)
 
 setMergeCompiledIncludes ($merge_compiled_includes)
 
 setLeftDelimiter ($left_delimiter)
 
 setRightDelimiter ($right_delimiter)
 
 setDebugging ($debugging)
 
 setConfigOverwrite ($config_overwrite)
 
 setConfigBooleanize ($config_booleanize)
 
 setConfigReadHidden ($config_read_hidden)
 
 setCompileLocking ($compile_locking)
 
 setDefaultResourceType ($default_resource_type)
 
 setCachingType ($caching_type)
 
 testInstall (&$errors=null)
 
 __destruct ()
 
 __get ($name)
 
 __set ($name, $value)
 
- Public Member Functions inherited from Smarty_Internal_TemplateBase
 fetch ($template=null, $cache_id=null, $compile_id=null, $parent=null)
 
 display ($template=null, $cache_id=null, $compile_id=null, $parent=null)
 
 isCached ($template=null, $cache_id=null, $compile_id=null, $parent=null)
 
 registerPlugin ($type, $name, $callback, $cacheable=true, $cache_attr=null)
 
 loadFilter ($type, $name)
 
 registerFilter ($type, $callback, $name=null)
 
 registerObject ($object_name, $object, $allowed_methods_properties=array(), $format=true, $block_methods=array())
 
 setCaching ($caching)
 
 setCacheLifetime ($cache_lifetime)
 
 setCompileId ($compile_id)
 
 setCacheId ($cache_id)
 
- Public Member Functions inherited from Smarty_Internal_Data
 __construct ()
 
 assign ($tpl_var, $value=null, $nocache=false)
 
 append ($tpl_var, $value=null, $merge=false, $nocache=false)
 
 assignGlobal ($varName, $value=null, $nocache=false)
 
 appendByRef ($tpl_var, &$value, $merge=false)
 
 assignByRef ($tpl_var, &$value, $nocache=false)
 
 getTemplateVars ($varName=null, Smarty_Internal_Data $_ptr=null, $searchParents=true)
 
 getVariable ($variable=null, Smarty_Internal_Data $_ptr=null, $searchParents=true, $error_enable=true)
 
 _mergeVars (Smarty_Internal_Data $data=null)
 
 __call ($name, $args)
 

Static Public Member Functions

static mutingErrorHandler ($errno, $errstr, $errfile, $errline, $errcontext)
 
static muteExpectedErrors ()
 
static unmuteExpectedErrors ()
 

Public Attributes

const SMARTY_VERSION = '3.1.29'
 
const SCOPE_LOCAL = 0
 
const SCOPE_PARENT = 2
 
const SCOPE_TPL_ROOT = 4
 
const SCOPE_ROOT = 8
 
const SCOPE_SMARTY = 16
 
const SCOPE_GLOBAL = 32
 
const SCOPE_BUBBLE_UP = 64
 
const CACHING_OFF = 0
 
const CACHING_LIFETIME_CURRENT = 1
 
const CACHING_LIFETIME_SAVED = 2
 
const CLEAR_EXPIRED = - 1
 
const COMPILECHECK_OFF = 0
 
const COMPILECHECK_ON = 1
 
const COMPILECHECK_CACHEMISS = 2
 
const DEBUG_OFF = 0
 
const DEBUG_ON = 1
 
const DEBUG_INDIVIDUAL = 2
 
const PHP_PASSTHRU = 0
 
const PHP_QUOTE = 1
 
const PHP_REMOVE = 2
 
const PHP_ALLOW = 3
 
const FILTER_POST = 'post'
 
const FILTER_PRE = 'pre'
 
const FILTER_OUTPUT = 'output'
 
const FILTER_VARIABLE = 'variable'
 
const PLUGIN_FUNCTION = 'function'
 
const PLUGIN_BLOCK = 'block'
 
const PLUGIN_COMPILER = 'compiler'
 
const PLUGIN_MODIFIER = 'modifier'
 
const PLUGIN_MODIFIERCOMPILER = 'modifiercompiler'
 
const RESOURCE_CACHE_OFF = 0
 
const RESOURCE_CACHE_AUTOMATIC = 1
 
const RESOURCE_CACHE_TEMPLATE = 2
 
const RESOURCE_CACHE_ON = 4
 
 $auto_literal = true
 
 $error_unassigned = false
 
 $use_include_path = false
 
 $_joined_template_dir = null
 
 $_joined_config_dir = null
 
 $default_template_handler_func = null
 
 $default_config_handler_func = null
 
 $default_plugin_handler_func = null
 
 $force_compile = false
 
 $compile_check = true
 
 $use_sub_dirs = false
 
 $allow_ambiguous_resources = false
 
 $merge_compiled_includes = false
 
 $force_cache = false
 
 $left_delimiter = "{"
 
 $right_delimiter = "}"
 
 $security_class = 'Smarty_Security'
 
 $security_policy = null
 
 $php_handling = self::PHP_PASSTHRU
 
 $allow_php_templates = false
 
 $debugging = false
 
 $debugging_ctrl = 'NONE'
 
 $smarty_debug_id = 'SMARTY_DEBUG'
 
 $debug_tpl = null
 
 $error_reporting = null
 
 $config_overwrite = true
 
 $config_booleanize = true
 
 $config_read_hidden = false
 
 $compile_locking = true
 
 $cache_locking = false
 
 $locking_timeout = 10
 
 $default_resource_type = 'file'
 
 $caching_type = 'file'
 
 $default_config_type = 'file'
 
 $resource_cache_mode = 1
 
 $cache_modified_check = false
 
 $registered_plugins = array()
 
 $registered_objects = array()
 
 $registered_classes = array()
 
 $registered_filters = array()
 
 $registered_resources = array()
 
 $registered_cache_resources = array()
 
 $autoload_filters = array()
 
 $default_modifiers = array()
 
 $escape_html = false
 
 $start_time = 0
 
 $_current_file = null
 
 $_parserdebug = false
 
 $_objType = 1
 
 $_debug = null
 
- Public Attributes inherited from Smarty_Internal_TemplateBase
 $cache_id = null
 
 $compile_id = null
 
 $caching = false
 
 $cache_lifetime = 3600
 
 $_cache = array()
 
- Public Attributes inherited from Smarty_Internal_Data
 $_objType = 4
 
 $template_class = 'Smarty_Internal_Template'
 
 $tpl_vars = array()
 
 $parent = null
 
 $config_vars = array()
 
 $ext = null
 

Static Public Attributes

static $global_tpl_vars = array()
 
static $_previous_error_handler = null
 
static $_muted_directories = array()
 
static $_MBSTRING = SMARTY_MBSTRING
 
static $_CHARSET = SMARTY_RESOURCE_CHAR_SET
 
static $_DATE_FORMAT = SMARTY_RESOURCE_DATE_FORMAT
 
static $_UTF8_MODIFIER = 'u'
 
static $_IS_WINDOWS = false
 

Constructor & Destructor Documentation

Smarty::__construct ( )

#@- Initialize new Smarty object

Smarty::__destruct ( )

Class destructor

Member Function Documentation

Smarty::__get (   $name)

<<magic>> Generic getter. Calls the appropriate getter function. Issues an E_USER_NOTICE if no valid getter is found.

Parameters
string$nameproperty name
Returns
mixed
Smarty::__set (   $name,
  $value 
)

<<magic>> Generic setter. Calls the appropriate setter function. Issues an E_USER_NOTICE if no valid setter is found.

Parameters
string$nameproperty name
mixed$valueparameter passed to setter
Smarty::_getTemplateId (   $template_name,
  $cache_id = null,
  $compile_id = null,
  $caching = null 
)

Get unique template id

Parameters
string$template_name
null | mixed$cache_id
null | mixed$compile_id
null$caching
Returns
string
Smarty::_realpath (   $path,
  $realpath = null 
)

Normalize path

  • remove /./ and /../
  • make it absolute if required
Parameters
string$pathfile path
bool$realpathleave $path relative
Returns
string
Smarty::addConfigDir (   $config_dir,
  $key = null 
)

Add config directory(s)

Parameters
string | array$config_dirdirectory(s) of config sources
mixed$keykey of the array element to assign the config dir to
Returns
Smarty current Smarty instance for chaining
Smarty::addPluginsDir (   $plugins_dir)

Adds directory of plugin files

Parameters
$plugins_dir
Returns
Smarty current Smarty instance for chaining
Smarty::addTemplateDir (   $template_dir,
  $key = null,
  $isConfig = false 
)

Add template directory(s)

Parameters
string | array$template_dirdirectory(s) of template sources
string$keyof the array element to assign the template dir to
bool$isConfigtrue for config_dir
Returns
Smarty current Smarty instance for chaining
Smarty::createTemplate (   $template,
  $cache_id = null,
  $compile_id = null,
  $parent = null,
  $do_clone = true 
)

creates a template object

Parameters
string$templatethe resource handle of the template file
mixed$cache_idcache id to be used with this template
mixed$compile_idcompile id to be used with this template
object$parentnext higher level of Smarty variables
boolean$do_cloneflag is Smarty object shall be cloned
Returns
object template object
Smarty::disableSecurity ( )

Disable security

Returns
Smarty current Smarty instance for chaining
Smarty::enableSecurity (   $security_class = null)

Loads security class and enables security

Parameters
string | Smarty_Security$security_classif a string is used, it must be class-name
Returns
Smarty current Smarty instance for chaining
Exceptions
SmartyExceptionwhen an invalid class name is provided
Smarty::getCacheDir ( )

Get cache directory

Returns
string path of cache directory
Smarty::getCompileDir ( )

Get compiled directory

Returns
string path to compiled templates
Smarty::getConfigDir (   $index = null)

Get config directory

Parameters
mixed$indexindex of directory to get, null to get all
Returns
array configuration directory
Smarty::getGlobal (   $varname = null)

Returns a single or all global variables

Parameters
string$varnamevariable name or null
Returns
string variable value or or array of variables
Smarty::getPluginsDir ( )

Get plugin directories

Returns
array list of plugin directories
Smarty::getTemplateDir (   $index = null,
  $isConfig = false 
)

Get template directories

Parameters
mixed$indexindex of directory to get, null to get all
bool$isConfigtrue for config_dir
Returns
array list of template directories, or directory of $index
Smarty::loadPlugin (   $plugin_name,
  $check = true 
)

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

Parameters
string$plugin_nameclass plugin name to load
bool$checkcheck if already loaded
Exceptions
SmartyException
Returns
string |boolean filepath of loaded file or false
static Smarty::muteExpectedErrors ( )
static

Enable error handler to mute expected messages

Returns
void
static Smarty::mutingErrorHandler (   $errno,
  $errstr,
  $errfile,
  $errline,
  $errcontext 
)
static
Smarty::setAutoLiteral (   $auto_literal)
Parameters
boolean$auto_literal
Smarty::setCacheDir (   $cache_dir)

Set cache directory

Parameters
string$cache_dirdirectory to store cached templates in
Returns
Smarty current Smarty instance for chaining
Smarty::setCachingType (   $caching_type)
Parameters
string$caching_type
Smarty::setCompileCheck (   $compile_check)
Parameters
boolean$compile_check
Smarty::setCompileDir (   $compile_dir)

Set compile directory

Parameters
string$compile_dirdirectory to store compiled templates in
Returns
Smarty current Smarty instance for chaining
Smarty::setCompileLocking (   $compile_locking)
Parameters
boolean$compile_locking
Smarty::setConfigBooleanize (   $config_booleanize)
Parameters
boolean$config_booleanize
Smarty::setConfigDir (   $config_dir)

Set config directory

Parameters
$config_dir
Returns
Smarty current Smarty instance for chaining
Smarty::setConfigOverwrite (   $config_overwrite)
Parameters
boolean$config_overwrite
Smarty::setConfigReadHidden (   $config_read_hidden)
Parameters
boolean$config_read_hidden
Smarty::setDebugging (   $debugging)
Parameters
boolean$debugging
Smarty::setDefaultResourceType (   $default_resource_type)
Parameters
string$default_resource_type
Smarty::setErrorReporting (   $error_reporting)
Parameters
int$error_reporting
Smarty::setEscapeHtml (   $escape_html)
Parameters
boolean$escape_html
Smarty::setForceCompile (   $force_compile)
Parameters
boolean$force_compile
Smarty::setLeftDelimiter (   $left_delimiter)
Parameters
string$left_delimiter
Smarty::setMergeCompiledIncludes (   $merge_compiled_includes)
Parameters
boolean$merge_compiled_includes
Smarty::setPluginsDir (   $plugins_dir)

Set plugins directory

Parameters
string | array$plugins_dirdirectory(s) of plugins
Returns
Smarty current Smarty instance for chaining
Smarty::setRightDelimiter (   $right_delimiter)
Parameters
string$right_delimiter
Smarty::setTemplateDir (   $template_dir,
  $isConfig = false 
)

Set template directory

Parameters
string | array$template_dirdirectory(s) of template sources
bool$isConfigtrue for config_dir
Returns
current Smarty instance for chaining
Smarty::setUseSubDirs (   $use_sub_dirs)
Parameters
boolean$use_sub_dirs
Smarty::templateExists (   $resource_name)

Check if a template resource exists

Parameters
string$resource_nametemplate name
Returns
boolean status
Smarty::testInstall ( $errors = null)

Test install

Parameters
null$errors
static Smarty::unmuteExpectedErrors ( )
static

Disable error handler muting expected messages

Returns
void

Member Data Documentation

Smarty::$_CHARSET = SMARTY_RESOURCE_CHAR_SET
static

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

Smarty::$_DATE_FORMAT = SMARTY_RESOURCE_DATE_FORMAT
static

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

Smarty::$_IS_WINDOWS = false
static

Flag denoting if operating system is windows

Smarty::$_MBSTRING = SMARTY_MBSTRING
static

Flag denoting if Multibyte String functions are available

Smarty::$_muted_directories = array()
static

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

Smarty::$_previous_error_handler = null
static

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

Smarty::$_UTF8_MODIFIER = 'u'
static

Flag denoting if PCRE should run in UTF-8 mode

Smarty::$global_tpl_vars = array()
static

#@- assigned global tpl vars

const Smarty::CACHING_OFF = 0

define caching modes

const Smarty::CLEAR_EXPIRED = - 1

define constant for clearing cache files be saved expiration dates

const Smarty::COMPILECHECK_OFF = 0

define compile check modes

const Smarty::DEBUG_OFF = 0

define debug modes

const Smarty::FILTER_POST = 'post'

filter types

const Smarty::PHP_PASSTHRU = 0

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

const Smarty::PLUGIN_FUNCTION = 'function'

plugin types

const Smarty::RESOURCE_CACHE_OFF = 0

Resource caching modes

const Smarty::SCOPE_LOCAL = 0

define variable scopes

const Smarty::SMARTY_VERSION = '3.1.29'

#@+ constant definitions smarty version


The documentation for this class was generated from the following file: