Class with shared template methodes

package Smarty
subpackage Template

 Methods

Handle unknown class methods

__call(string $name, array $args) 

Parameters

$name

string

unknown method-name

$args

array

argument array

Return internal filter name

_get_filter_name(callback $function_name) : string

Parameters

$function_name

callback

Returns

stringinternal filter name

appends values to template variables

append(array | string $tpl_var, mixed $value, boolean $merge, boolean $nocache) : \Smarty_Internal_Data
Inherited
inherited_from \Smarty_Internal_Data::append()

Parameters

$tpl_var

arraystring

the template variable name(s)

$value

mixed

the value to append

$merge

boolean

flag if array elements shall be merged

$nocache

boolean

if true any output of this variable will be not cached

Returns

\Smarty_Internal_Datacurrent Smarty_Internal_Data (or Smarty or Smarty_Internal_Template) instance for chaining

appends values to template variables by reference

appendByRef(string $tpl_var, mixed $value, boolean $merge) : \Smarty_Internal_Data
Inherited
inherited_from \Smarty_Internal_Data::appendByRef()

Parameters

$tpl_var

string

the template variable name

$value

mixed

&$value the referenced value to append

$merge

boolean

flag if array elements shall be merged

Returns

\Smarty_Internal_Datacurrent Smarty_Internal_Data (or Smarty or Smarty_Internal_Template) instance for chaining

assigns a Smarty variable

assign(array | string $tpl_var, mixed $value, boolean $nocache) : \Smarty_Internal_Data
Inherited
inherited_from \Smarty_Internal_Data::assign()

Parameters

$tpl_var

arraystring

the template variable name(s)

$value

mixed

the value to assign

$nocache

boolean

if true any output of this variable will be not cached

Returns

\Smarty_Internal_Datacurrent Smarty_Internal_Data (or Smarty or Smarty_Internal_Template) instance for chaining

assigns values to template variables by reference

assignByRef(string $tpl_var, $value, boolean $nocache) : \Smarty_Internal_Data
Inherited
inherited_from \Smarty_Internal_Data::assignByRef()

Parameters

$tpl_var

string

the template variable name

$value

$nocache

boolean

if true any output of this variable will be not cached

Returns

\Smarty_Internal_Datacurrent Smarty_Internal_Data (or Smarty or Smarty_Internal_Template) instance for chaining

assigns a global Smarty variable

assignGlobal(string $varname, mixed $value, boolean $nocache) : \Smarty_Internal_Data
Inherited
inherited_from \Smarty_Internal_Data::assignGlobal()

Parameters

$varname

string

the global variable name

$value

mixed

the value to assign

$nocache

boolean

if true any output of this variable will be not cached

Returns

\Smarty_Internal_Datacurrent Smarty_Internal_Data (or Smarty or Smarty_Internal_Template) instance for chaining

clear all the assigned template variables.

clearAllAssign() : \Smarty_Internal_Data
Inherited
inherited_from \Smarty_Internal_Data::clearAllAssign()

Returns

\Smarty_Internal_Datacurrent Smarty_Internal_Data (or Smarty or Smarty_Internal_Template) instance for chaining

clear the given assigned template variable.

clearAssign(string | array $tpl_var) : \Smarty_Internal_Data
Inherited
inherited_from \Smarty_Internal_Data::clearAssign()

Parameters

$tpl_var

stringarray

the template variable(s) to clear

Returns

\Smarty_Internal_Datacurrent Smarty_Internal_Data (or Smarty or Smarty_Internal_Template) instance for chaining

Deassigns a single or all config variables

clearConfig(string $varname) : \Smarty_Internal_Data
Inherited
inherited_from \Smarty_Internal_Data::clearConfig()

Parameters

$varname

string

variable name or null

Returns

\Smarty_Internal_Datacurrent Smarty_Internal_Data (or Smarty or Smarty_Internal_Template) instance for chaining

load a config file, optionally load just selected sections

configLoad(string $config_file, mixed $sections) : \Smarty_Internal_Data
Inherited
inherited_from \Smarty_Internal_Data::configLoad()

Parameters

$config_file

string

filename

$sections

mixed

array of section names, single section or null

Returns

\Smarty_Internal_Datacurrent Smarty_Internal_Data (or Smarty or Smarty_Internal_Template) instance for chaining

creates a data object

createData(object $parent) 
returns Smarty_Data data object

Parameters

$parent

object

next higher level of Smarty variables

displays a Smarty template

display(string $template, mixed $cache_id, mixed $compile_id, object $parent) 

Parameters

$template

string

the resource handle of the template file or template object

$cache_id

mixed

cache id to be used with this template

$compile_id

mixed

compile id to be used with this template

$parent

object

next higher level of Smarty variables

fetches a rendered Smarty template

fetch(string $template, mixed $cache_id, mixed $compile_id, object $parent, bool $display, bool $merge_tpl_vars, bool $no_output_filter) : string

Parameters

$template

string

the resource handle of the template file or template object

$cache_id

mixed

cache id to be used with this template

$compile_id

mixed

compile id to be used with this template

$parent

object

next higher level of Smarty variables

$display

bool

true: display, false: fetch

$merge_tpl_vars

bool

if true parent template variables merged in to local scope

$no_output_filter

bool

if true do not run output filter

Returns

stringrendered template output

gets a config variable

getConfigVariable(string $variable, $error_enable) : mixed
Inherited
inherited_from \Smarty_Internal_Data::getConfigVariable()

Parameters

$variable

string

the name of the config variable

$error_enable

Returns

mixedthe value of the config variable

Returns a single or all config variables

getConfigVars(string $varname, $search_parents) : string
Inherited
inherited_from \Smarty_Internal_Data::getConfigVars()

Parameters

$varname

string

variable name or null

$search_parents

Returns

stringvariable value or or array of variables

return a reference to a registered object

getRegisteredObject(string $name) : object

Parameters

$name

string

object name

Exceptions

\SmartyException if no such object is found

Returns

object

gets a stream variable

getStreamVariable(string $variable) : mixed
Inherited
inherited_from \Smarty_Internal_Data::getStreamVariable()

Parameters

$variable

string

the stream of the variable

Returns

mixedthe value of the stream variable

Returns a single or all template variables

getTemplateVars(string $varname, string $_ptr, boolean $search_parents) : string
Inherited
inherited_from \Smarty_Internal_Data::getTemplateVars()

Parameters

$varname

string

variable name or null

$_ptr

string

optional pointer to data object

$search_parents

boolean

include parent templates?

Returns

stringvariable value or or array of variables

gets the object of a Smarty variable

getVariable(string $variable, object $_ptr, boolean $search_parents, $error_enable) : object
Inherited
inherited_from \Smarty_Internal_Data::getVariable()

Parameters

$variable

string

the name of the Smarty variable

$_ptr

object

optional pointer to data object

$search_parents

boolean

search also in parent data

$error_enable

Returns

objectthe object of the variable

test if cache is valid

isCached(string | object $template, mixed $cache_id, mixed $compile_id, object $parent) : boolean

Parameters

$template

stringobject

the resource handle of the template file or template object

$cache_id

mixed

cache id to be used with this template

$compile_id

mixed

compile id to be used with this template

$parent

object

next higher level of Smarty variables

Returns

booleancache status

load a filter of specified type and name

loadFilter(string $type, string $name) 

Parameters

$type

string

filter type

$name

string

filter name

Exceptions

\SmartyException if filter could not be loaded

Registers a cache resource to cache a template's output

registerCacheResource(string $type, \Smarty_CacheResource $callback) : \Smarty_Internal_Templatebase

Parameters

$type

string

name of cache resource type

$callback

\Smarty_CacheResource

instance of Smarty_CacheResource to handle output caching

Returns

\Smarty_Internal_Templatebasecurrent Smarty_Internal_Templatebase (or Smarty or Smarty_Internal_Template) instance for chaining

Registers static classes to be used in templates

registerClass($class_name, string $class_impl) : \Smarty_Internal_Templatebase

Parameters

$class_name

$class_impl

string

the referenced PHP class to register

Exceptions

\SmartyException if $class_impl does not refer to an existing class

Returns

\Smarty_Internal_Templatebasecurrent Smarty_Internal_Templatebase (or Smarty or Smarty_Internal_Template) instance for chaining

Registers a default template handler

registerDefaultConfigHandler(callable $callback) : \Smarty_Internal_Templatebase

Parameters

$callback

callable

class/method name

Exceptions

\SmartyException if $callback is not callable

Returns

\Smarty_Internal_Templatebasecurrent Smarty_Internal_Templatebase (or Smarty or Smarty_Internal_Template) instance for chaining

Registers a default plugin handler

registerDefaultPluginHandler(callable $callback) : \Smarty_Internal_Templatebase

Parameters

$callback

callable

class/method name

Exceptions

\SmartyException if $callback is not callable

Returns

\Smarty_Internal_Templatebasecurrent Smarty_Internal_Templatebase (or Smarty or Smarty_Internal_Template) instance for chaining

Registers a default template handler

registerDefaultTemplateHandler(callable $callback) : \Smarty_Internal_Templatebase

Parameters

$callback

callable

class/method name

Exceptions

\SmartyException if $callback is not callable

Returns

\Smarty_Internal_Templatebasecurrent Smarty_Internal_Templatebase (or Smarty or Smarty_Internal_Template) instance for chaining

Registers a filter function

registerFilter(string $type, callback $callback) : \Smarty_Internal_Templatebase

Parameters

$type

string

filter type

$callback

callback

Returns

\Smarty_Internal_Templatebasecurrent Smarty_Internal_Templatebase (or Smarty or Smarty_Internal_Template) instance for chaining

Registers object to be used in templates

registerObject($object_name, object $object_impl, array $allowed, boolean $smarty_args, array $block_methods) : \Smarty_Internal_Templatebase

Parameters

$object_name

$object_impl

object

the referenced PHP object to register

$allowed

array

list of allowed methods (empty = all)

$smarty_args

boolean

smarty argument format, else traditional

$block_methods

array

list of block-methods

Exceptions

\SmartyException if any of the methods in $allowed or $block_methods are invalid

Returns

\Smarty_Internal_Templatebasecurrent Smarty_Internal_Templatebase (or Smarty or Smarty_Internal_Template) instance for chaining

Registers plugin to be used in templates

registerPlugin(string $type, string $tag, callback $callback, boolean $cacheable, array $cache_attr) : \Smarty_Internal_Templatebase

Parameters

$type

string

plugin type

$tag

string

name of template tag

$callback

callback

PHP callback to register

$cacheable

boolean

if true (default) this fuction is cachable

$cache_attr

array

caching attributes if any

Exceptions

\SmartyException when the plugin tag is invalid

Returns

\Smarty_Internal_Templatebasecurrent Smarty_Internal_Templatebase (or Smarty or Smarty_Internal_Template) instance for chaining

Registers a resource to fetch a template

registerResource(string $type, \Smarty_Resource | array $callback) : \Smarty_Internal_Templatebase

Parameters

$type

string

name of resource type

$callback

\Smarty_Resourcearray

or instance of Smarty_Resource, or array of callbacks to handle resource (deprecated)

Returns

\Smarty_Internal_Templatebasecurrent Smarty_Internal_Templatebase (or Smarty or Smarty_Internal_Template) instance for chaining

unload a filter of specified type and name

unloadFilter(string $type, string $name) : \Smarty_Internal_Templatebase

Parameters

$type

string

filter type

$name

string

filter name

Returns

\Smarty_Internal_Templatebasecurrent Smarty_Internal_Templatebase (or Smarty or Smarty_Internal_Template) instance for chaining

Unregisters a cache resource

unregisterCacheResource(string $type) : \Smarty_Internal_Templatebase

Parameters

$type

string

name of cache resource type

Returns

\Smarty_Internal_Templatebasecurrent Smarty_Internal_Templatebase (or Smarty or Smarty_Internal_Template) instance for chaining

Unregisters a filter function

unregisterFilter(string $type, callback $callback) : \Smarty_Internal_Templatebase

Parameters

$type

string

filter type

$callback

callback

Returns

\Smarty_Internal_Templatebasecurrent Smarty_Internal_Templatebase (or Smarty or Smarty_Internal_Template) instance for chaining

unregister an object

unregisterObject(string $name) : \Smarty_Internal_Templatebase

Parameters

$name

string

object name

Returns

\Smarty_Internal_Templatebasecurrent Smarty_Internal_Templatebase (or Smarty or Smarty_Internal_Template) instance for chaining

Unregister Plugin

unregisterPlugin(string $type, string $tag) : \Smarty_Internal_Templatebase

Parameters

$type

string

of plugin

$tag

string

name of plugin

Returns

\Smarty_Internal_Templatebasecurrent Smarty_Internal_Templatebase (or Smarty or Smarty_Internal_Template) instance for chaining

Unregisters a resource

unregisterResource(string $type) : \Smarty_Internal_Templatebase

Parameters

$type

string

name of resource type

Returns

\Smarty_Internal_Templatebasecurrent Smarty_Internal_Templatebase (or Smarty or Smarty_Internal_Template) instance for chaining

preg_replace callback to convert camelcase getter/setter to underscore property names

replaceCamelcase(string $match) : string

Parameters

$match

string

match string

Returns

stringreplacemant

 Properties

 

$config_vars : array
Inherited
inherited_from \Smarty_Internal_Data::$$config_vars
 

$parent : \Smarty_Internal_Template
Inherited
inherited_from \Smarty_Internal_Data::$$parent
 

$template_class : string
Inherited
inherited_from \Smarty_Internal_Data::$$template_class
 

$tpl_vars : array
Inherited
inherited_from \Smarty_Internal_Data::$$tpl_vars