PEEL Shopping
Open source ecommerce : PEEL Shopping
Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes | Static Protected Attributes
Twig_Template Class Reference

Default base class for compiled templates. More...

Inheritance diagram for Twig_Template:
Twig_TemplateInterface

Public Member Functions

 __construct (Twig_Environment $env)
 Constructor. More...
 
 getTemplateName ()
 Returns the template name. More...
 
 getEnvironment ()
 {Returns the bound environment for this template.
Returns
Twig_Environment The current environment
} More...
 
 getParent (array $context)
 Returns the parent template. More...
 
 isTraitable ()
 
 displayParentBlock ($name, array $context, array $blocks=array())
 Displays a parent block. More...
 
 displayBlock ($name, array $context, array $blocks=array())
 Displays a block. More...
 
 renderParentBlock ($name, array $context, array $blocks=array())
 Renders a parent block. More...
 
 renderBlock ($name, array $context, array $blocks=array())
 Renders a block. More...
 
 hasBlock ($name)
 Returns whether a block exists or not. More...
 
 getBlockNames ()
 Returns all block names. More...
 
 getBlocks ()
 Returns all blocks. More...
 
 display (array $context, array $blocks=array())
 {Displays the template with the given context.
Parameters
array$contextAn array of parameters to pass to the template
array$blocksAn array of blocks to pass to the template
} More...
 
 render (array $context)
 {Renders the template with the given context and returns it as string.
Parameters
array$contextAn array of parameters to pass to the template
Returns
string The rendered template
} More...
 

Static Public Member Functions

static clearCache ()
 This method is only useful when testing Twig. More...
 

Protected Member Functions

 doGetParent (array $context)
 
 displayWithErrorHandling (array $context, array $blocks=array())
 
 doDisplay (array $context, array $blocks=array())
 Auto-generated method to display the template with the given context. More...
 
 getContext ($context, $item, $ignoreStrictCheck=false)
 Returns a variable from the context. More...
 
 getAttribute ($object, $item, array $arguments=array(), $type=Twig_TemplateInterface::ANY_CALL, $isDefinedTest=false, $ignoreStrictCheck=false)
 Returns the attribute value for a given array/object. More...
 

Protected Attributes

 $parent
 
 $parents
 
 $env
 
 $blocks
 
 $traits
 

Static Protected Attributes

static $cache = array()
 

Additional Inherited Members

- Data Fields inherited from Twig_TemplateInterface
const ANY_CALL = 'any'
 
const ARRAY_CALL = 'array'
 
const METHOD_CALL = 'method'
 

Detailed Description

Default base class for compiled templates.

Author
Fabien Potencier fabie.nosp@m.n@sy.nosp@m.mfony.nosp@m..com

Definition at line 18 of file Template.php.

Constructor & Destructor Documentation

__construct ( Twig_Environment  $env)

Constructor.

Parameters
Twig_Environment$envA Twig_Environment instance

Definition at line 33 of file Template.php.

Member Function Documentation

static clearCache ( )
static

This method is only useful when testing Twig.

Do not use it.

Definition at line 451 of file Template.php.

display ( array  $context,
array  $blocks = array() 
)

{Displays the template with the given context.

Parameters
array$contextAn array of parameters to pass to the template
array$blocksAn array of blocks to pass to the template
}

Implements Twig_TemplateInterface.

Definition at line 236 of file Template.php.

displayBlock (   $name,
array  $context,
array  $blocks = array() 
)

Displays a block.

This method is for internal use only and should never be called directly.

Parameters
string$nameThe block name to display
array$contextThe context
array$blocksThe current set of blocks

Definition at line 126 of file Template.php.

displayParentBlock (   $name,
array  $context,
array  $blocks = array() 
)

Displays a parent block.

This method is for internal use only and should never be called directly.

Parameters
string$nameThe block name to display from the parent
array$contextThe context
array$blocksThe current set of blocks

Definition at line 103 of file Template.php.

displayWithErrorHandling ( array  $context,
array  $blocks = array() 
)
protected

Definition at line 261 of file Template.php.

doDisplay ( array  $context,
array  $blocks = array() 
)
abstractprotected

Auto-generated method to display the template with the given context.

Parameters
array$contextAn array of parameters to pass to the template
array$blocksAn array of blocks to pass to the template
doGetParent ( array  $context)
protected

Definition at line 83 of file Template.php.

getAttribute (   $object,
  $item,
array  $arguments = array(),
  $type = Twig_TemplateInterface::ANY_CALL,
  $isDefinedTest = false,
  $ignoreStrictCheck = false 
)
protected

Returns the attribute value for a given array/object.

Parameters
mixed$objectThe object or array from where to get the item
mixed$itemThe item to get from the array or object
array$argumentsAn array of arguments to pass if the item is an object method
string$typeThe type of attribute (
See also
Twig_TemplateInterface)
Parameters
Boolean$isDefinedTestWhether this is only a defined check
Boolean$ignoreStrictCheckWhether to ignore the strict attribute check or not
Returns
mixed The attribute value, or a Boolean when $isDefinedTest is true, or null when the attribute is not set and $ignoreStrictCheck is true
Exceptions
Twig_Error_Runtimeif the attribute does not exist and Twig is running in strict mode and $isDefinedTest is false

Definition at line 337 of file Template.php.

getBlockNames ( )

Returns all block names.

This method is for internal use only and should never be called directly.

Returns
array An array of block names
See also
hasBlock

Definition at line 213 of file Template.php.

getBlocks ( )

Returns all blocks.

This method is for internal use only and should never be called directly.

Returns
array An array of blocks
See also
hasBlock

Definition at line 228 of file Template.php.

getContext (   $context,
  $item,
  $ignoreStrictCheck = false 
)
finalprotected

Returns a variable from the context.

This method is for internal use only and should never be called directly.

This method should not be overridden in a sub-class as this is an implementation detail that has been introduced to optimize variable access for versions of PHP before 5.4. This is not a way to override the way to get a variable value.

Parameters
array$contextThe context
string$itemThe variable to return from the context
Boolean$ignoreStrictCheckWhether to ignore the strict variable check or not
Returns
The content of the context variable
Exceptions
Twig_Error_Runtimeif the variable does not exist and Twig is running in strict mode

Definition at line 310 of file Template.php.

getEnvironment ( )

{Returns the bound environment for this template.

Returns
Twig_Environment The current environment
}

Implements Twig_TemplateInterface.

Definition at line 50 of file Template.php.

getParent ( array  $context)

Returns the parent template.

This method is for internal use only and should never be called directly.

Returns
Twig_TemplateInterface|false The parent template or false if there is no parent

Definition at line 63 of file Template.php.

getTemplateName ( )
abstract

Returns the template name.

Returns
string The template name
hasBlock (   $name)

Returns whether a block exists or not.

This method is for internal use only and should never be called directly.

This method does only return blocks defined in the current template or defined in "used" traits.

It does not return blocks from parent templates as the parent template name can be dynamic, which is only known based on the current context.

Parameters
string$nameThe block name
Returns
Boolean true if the block exists, false otherwise

Definition at line 198 of file Template.php.

isTraitable ( )

Definition at line 88 of file Template.php.

render ( array  $context)

{Renders the template with the given context and returns it as string.

Parameters
array$contextAn array of parameters to pass to the template
Returns
string The rendered template
}

Implements Twig_TemplateInterface.

Definition at line 244 of file Template.php.

renderBlock (   $name,
array  $context,
array  $blocks = array() 
)

Renders a block.

This method is for internal use only and should never be called directly.

Parameters
string$nameThe block name to render
array$contextThe context
array$blocksThe current set of blocks
Returns
string The rendered block

Definition at line 173 of file Template.php.

renderParentBlock (   $name,
array  $context,
array  $blocks = array() 
)

Renders a parent block.

This method is for internal use only and should never be called directly.

Parameters
string$nameThe block name to render from the parent
array$contextThe context
array$blocksThe current set of blocks
Returns
string The rendered block

Definition at line 153 of file Template.php.

Field Documentation

$blocks
protected

Definition at line 25 of file Template.php.

$cache = array()
staticprotected

Definition at line 20 of file Template.php.

$env
protected

Definition at line 24 of file Template.php.

$parent
protected

Definition at line 22 of file Template.php.

$parents
protected

Definition at line 23 of file Template.php.

$traits
protected

Definition at line 26 of file Template.php.


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

This documentation for Open ecommerce PEEL Shopping and PEEL.fr has been generated by Doxygen on Thu Oct 15 2015 14:41:45 - Peel ecommerce is a product of Agence web Advisto SAS. All rights reserved.