Class Smarty_Internal_Template

Description

Main class with template data structures and methods

Located in /libs/sysplugins/smarty_internal_template.php (line 22)

Smarty_Internal_Data
   |
   --Smarty_Internal_TemplateBase
      |
      --Smarty_Internal_Template
Variable Summary
Method Summary
Smarty_Internal_Template __construct (string $template_resource, Smarty $smarty, [Smarty_Internal_Template $_parent = null], [mixed $_cache_id = null], [mixed $_compile_id = null], [bool $_caching = null], [int $_cache_lifetime = null])
void __destruct ()
void createLocalArrayVariable (string $tpl_var, [bool $nocache = false], [int $scope = Smarty::SCOPE_LOCAL])
string createTemplateCodeFrame ([string $content = ''], [bool $cache = false])
bool decodeProperties (array $properties, [bool $cache = false])
array &getScope (int $scope)
mixed getScopePointer (int $scope)
string getSubTemplate (string $template, mixed $cache_id, mixed $compile_id, integer $caching, integer $cache_lifetime,  $data, int $parent_scope, array $vars)
boolean mustCompile ()
string setupInlineSubTemplate (string $template, mixed $cache_id, mixed $compile_id, integer $caching, integer $cache_lifetime,  $data, int $parent_scope, string $hash, array $vars)
bool writeCachedContent ( $content)
int _count (mixed $value)
void __get (string $property_name)
void __set (string $property_name, mixed $value)
Variables
array $block_data = array() (line 93)

blocks for template inheritance

  • access: public
string $cacher_class = null (line 48)

Class name

  • access: public
string $cache_id = null (line 28)

cache_id

  • access: public
integer $cache_lifetime = null (line 43)

cache lifetime in seconds

  • access: public
boolean $caching = null (line 38)

caching enabled

  • access: public
string $caching_type = null (line 56)

caching type

Must be an element of $cache_resource_types.

  • access: public
string $compile_id = null (line 33)

$compile_id

  • access: public
bool $has_nocache_code = false (line 71)

flag if template does contain nocache code sections

  • access: public
bool $mustCompile = null (line 66)

flag if compiled template is invalid and must be (re)compiled

  • access: public
array $properties = array('file_dependency' => array(),'nocache_hash'=>'','function'=>array()) (line 76)

special compiled and cached template properties

  • access: public
array $required_plugins = array('compiled' => array(),'nocache'=>array()) (line 83)

required plugins

  • access: public
Smarty $smarty = null (line 88)

Global smarty instance

  • access: public
string $template_resource = null (line 61)

Template resource

  • access: public
array $used_tags = array() (line 103)

optional log of tag/attributes

  • access: public
array $variable_filters = array() (line 98)

variable filters

  • access: public

Inherited Variables

Inherited from Smarty_Internal_Data

Smarty_Internal_Data::$config_vars
Smarty_Internal_Data::$parent
Smarty_Internal_Data::$template_class
Smarty_Internal_Data::$tpl_vars
Methods
Constructor __construct (line 119)

Create template data object

Some of the global Smarty settings copied to template scope It load the required template resources and cacher plugins

  • access: public
Smarty_Internal_Template __construct (string $template_resource, Smarty $smarty, [Smarty_Internal_Template $_parent = null], [mixed $_cache_id = null], [mixed $_compile_id = null], [bool $_caching = null], [int $_cache_lifetime = null])
  • string $template_resource: template resource string
  • Smarty $smarty: Smarty instance
  • Smarty_Internal_Template $_parent: back pointer to parent object with variables or null
  • mixed $_cache_id: cache id or null
  • mixed $_compile_id: compile id or null
  • bool $_caching: use caching?
  • int $_cache_lifetime: cache life-time in seconds
Destructor __destruct (line 629)

Template data object destrutor

  • access: public
void __destruct ()
compileTemplateSource (line 162)

Compiles the template

If the template is not evaluated the compiled template is saved on disk

  • access: public
void compileTemplateSource ()
createLocalArrayVariable (line 461)

Template code runtime function to create a local Smarty variable for array assignments

  • access: public
void createLocalArrayVariable (string $tpl_var, [bool $nocache = false], [int $scope = Smarty::SCOPE_LOCAL])
  • string $tpl_var: tempate variable name
  • bool $nocache: cache mode of variable
  • int $scope: scope of variable
createTemplateCodeFrame (line 325)

Create code frame for compiled and cached templates

  • access: public
string createTemplateCodeFrame ([string $content = ''], [bool $cache = false])
  • string $content: optional template content
  • bool $cache: flag for cache file
decodeProperties (line 400)

This function is executed automatically when a compiled or cached template file is included

  • Decode saved properties from compiled template and cache files
  • Check if compiled or cache file is valid

  • return: flag if compiled or cache file is valid
  • access: public
bool decodeProperties (array $properties, [bool $cache = false])
  • array $properties: special template properties
  • bool $cache: flag if called from cache file
getScope (line 482)

Template code runtime function to get pointer to template variable array of requested scope

  • return: array of template variables
  • access: public
array &getScope (int $scope)
  • int $scope: requested variable scope
getScopePointer (line 505)

Get parent or root of template parent chain

  • return: object
  • access: public
mixed getScopePointer (int $scope)
  • int $scope: pqrent or root scope
getSubTemplate (line 243)

Template code runtime function to get subtemplate content

  • return: template content
  • access: public
string getSubTemplate (string $template, mixed $cache_id, mixed $compile_id, integer $caching, integer $cache_lifetime,  $data, int $parent_scope, array $vars)
  • string $template: the resource handle of the template file
  • mixed $cache_id: cache id to be used with this template
  • mixed $compile_id: compile id to be used with this template
  • integer $caching: cache mode
  • integer $cache_lifetime: life time of cache data
  • array $vars: optional variables to assign
  • int $parent_scope: scope in which {include} should execute
  • $data
mustCompile (line 145)

Returns if the current template must be compiled by the Smarty compiler

It does compare the timestamps of template source and the compiled templates and checks the force compile configuration

  • return: true if the template must be compiled
  • access: public
boolean mustCompile ()
setupInlineSubTemplate (line 291)

Template code runtime function to set up an inline subtemplate

  • return: template content
  • access: public
string setupInlineSubTemplate (string $template, mixed $cache_id, mixed $compile_id, integer $caching, integer $cache_lifetime,  $data, int $parent_scope, string $hash, array $vars)
  • string $template: the resource handle of the template file
  • mixed $cache_id: cache id to be used with this template
  • mixed $compile_id: compile id to be used with this template
  • integer $caching: cache mode
  • integer $cache_lifetime: life time of cache data
  • array $vars: optional variables to assign
  • int $parent_scope: scope in which {include} should execute
  • string $hash: nocache hash code
  • $data
writeCachedContent (line 215)

Writes the cached template output

  • access: public
bool writeCachedContent ( $content)
  • $content
_count (line 525)

[util function] counts an array, arrayaccess/traversable or PDOStatement object

  • return: the count for arrays and objects that implement countable, 1 for other objects that don't, and 0 for empty elements
  • access: public
int _count (mixed $value)
  • mixed $value
__get (line 584)

get Smarty property in template context

  • access: public
void __get (string $property_name)
  • string $property_name: property name
__set (line 558)

set Smarty property in template context

  • access: public
void __set (string $property_name, mixed $value)
  • string $property_name: property name
  • mixed $value: value

Inherited Methods

Inherited From Smarty_Internal_TemplateBase

Smarty_Internal_TemplateBase::createData()
Smarty_Internal_TemplateBase::display()
Smarty_Internal_TemplateBase::fetch()
Smarty_Internal_TemplateBase::getRegisteredObject()
Smarty_Internal_TemplateBase::isCached()
Smarty_Internal_TemplateBase::loadFilter()
Smarty_Internal_TemplateBase::registerCacheResource()
Smarty_Internal_TemplateBase::registerClass()
Smarty_Internal_TemplateBase::registerDefaultConfigHandler()
Smarty_Internal_TemplateBase::registerDefaultPluginHandler()
Smarty_Internal_TemplateBase::registerDefaultTemplateHandler()
Smarty_Internal_TemplateBase::registerFilter()
Smarty_Internal_TemplateBase::registerObject()
Smarty_Internal_TemplateBase::registerPlugin()
Smarty_Internal_TemplateBase::registerResource()
Smarty_Internal_TemplateBase::unregisterCacheResource()
Smarty_Internal_TemplateBase::unregisterFilter()
Smarty_Internal_TemplateBase::unregisterObject()
Smarty_Internal_TemplateBase::unregisterPlugin()
Smarty_Internal_TemplateBase::unregisterResource()
Smarty_Internal_TemplateBase::_get_filter_name()
Smarty_Internal_TemplateBase::__call()

Inherited From Smarty_Internal_Data

Smarty_Internal_Data::append()
Smarty_Internal_Data::appendByRef()
Smarty_Internal_Data::assign()
Smarty_Internal_Data::assignByRef()
Smarty_Internal_Data::assignGlobal()
Smarty_Internal_Data::clearAllAssign()
Smarty_Internal_Data::clearAssign()
Smarty_Internal_Data::clearConfig()
Smarty_Internal_Data::configLoad()
Smarty_Internal_Data::getConfigVariable()
Smarty_Internal_Data::getConfigVars()
Smarty_Internal_Data::getStreamVariable()
Smarty_Internal_Data::getTemplateVars()
Smarty_Internal_Data::getVariable()

Documentation generated on Sun, 11 Sep 2011 11:03:31 +0200 by phpDocumentor 1.4.1