ILIAS
release_5-4 Revision v5.4.26-12-gabc799a52e6
|
Default base class for compiled templates. More...
Public Member Functions | |
__construct (Twig_Environment $env) | |
__toString () | |
getTemplateName () | |
Returns the template name. More... | |
getDebugInfo () | |
Returns debug information about the template. More... | |
getSource () | |
Returns the template source code. More... | |
getSourceContext () | |
Returns information about the original template source code. More... | |
getEnvironment () | |
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(), $useBlocks=true) | |
Displays a block. More... | |
renderParentBlock ($name, array $context, array $blocks=array()) | |
Renders a parent block. More... | |
renderBlock ($name, array $context, array $blocks=array(), $useBlocks=true) | |
Renders a block. More... | |
hasBlock ($name, array $context=null, array $blocks=array()) | |
Returns whether a block exists or not in the current context of the template. More... | |
getBlockNames (array $context=null, array $blocks=array()) | |
Returns all block names in the current context of the template. More... | |
getBlocks () | |
Returns all blocks. More... | |
display (array $context, array $blocks=array()) | |
Displays the template with the given context. More... | |
render (array $context) | |
Renders the template with the given context and returns it as string. More... | |
Protected Member Functions | |
doGetParent (array $context) | |
loadTemplate ($template, $templateName=null, $line=null, $index=null) | |
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=self::ANY_CALL, $isDefinedTest=false, $ignoreStrictCheck=false) | |
Returns the attribute value for a given array/object. More... | |
Protected Attributes | |
$parent | |
$parents = array() | |
$env | |
$blocks = array() | |
$traits = array() | |
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' |
Default base class for compiled templates.
This class is an implementation detail of how template compilation currently works, which might change. It should never be used directly. Use $twig->load() instead, which returns an instance of Twig_TemplateWrapper.
Definition at line 24 of file Template.php.
Twig_Template::__construct | ( | Twig_Environment | $env | ) |
Definition at line 37 of file Template.php.
References $env.
Twig_Template::__toString | ( | ) |
Definition at line 45 of file Template.php.
References getTemplateName().
Twig_Template::display | ( | array | $context, |
array | $blocks = array() |
||
) |
Displays the template with the given context.
array | $context | An array of parameters to pass to the template |
array | $blocks | An array of blocks to pass to the template |
Implements Twig_TemplateInterface.
Definition at line 401 of file Template.php.
References $blocks, and displayWithErrorHandling().
Referenced by render().
Twig_Template::displayBlock | ( | $name, | |
array | $context, | ||
array | $blocks = array() , |
||
$useBlocks = true |
|||
) |
Displays a block.
This method is for internal use only and should never be called directly.
string | $name | The block name to display |
array | $context | The context |
array | $blocks | The current set of blocks |
bool | $useBlocks | Whether to use the current set of blocks |
Definition at line 193 of file Template.php.
References $blocks, $name, $parent, $template, getParent(), Twig_Error\getSourceContext(), Twig_Error\getTemplateLine(), getTemplateName(), Twig_Error\guess(), Twig_Error\setSourceContext(), and Twig_Error\setTemplateLine().
Referenced by renderBlock().
Twig_Template::displayParentBlock | ( | $name, | |
array | $context, | ||
array | $blocks = array() |
||
) |
Displays a parent block.
This method is for internal use only and should never be called directly.
string | $name | The block name to display from the parent |
array | $context | The context |
array | $blocks | The current set of blocks |
Definition at line 167 of file Template.php.
References $blocks, $name, $parent, getParent(), and getSourceContext().
Referenced by renderParentBlock().
|
protected |
Definition at line 429 of file Template.php.
References $blocks, doDisplay(), getSourceContext(), Twig_Error\getSourceContext(), Twig_Error\getTemplateLine(), Twig_Error\guess(), Twig_Error\setSourceContext(), and Twig_Error\setTemplateLine().
Referenced by display().
|
abstractprotected |
Auto-generated method to display the template with the given context.
array | $context | An array of parameters to pass to the template |
array | $blocks | An array of blocks to pass to the template |
Referenced by displayWithErrorHandling().
|
protected |
Definition at line 145 of file Template.php.
Referenced by getParent().
|
protected |
Returns the attribute value for a given array/object.
mixed | $object | The object or array from where to get the item |
mixed | $item | The item to get from the array or object |
array | $arguments | An array of arguments to pass if the item is an object method |
string | $type | The type of attribute ( |
bool | $isDefinedTest | Whether this is only a defined check |
bool | $ignoreStrictCheck | Whether to ignore the strict attribute check or not |
Twig_Error_Runtime | if the attribute does not exist and Twig is running in strict mode and $isDefinedTest is false |
Definition at line 509 of file Template.php.
References $cache, $message, $name, $ret, $type, getSourceContext(), and getTemplateName().
Twig_Template::getBlockNames | ( | array | $context = null , |
array | $blocks = array() |
||
) |
Returns all block names in the current context of the template.
This method checks blocks defined in the current template or defined in "used" traits or defined in parent templates.
array | $context | The context |
array | $blocks | The current set of blocks |
Definition at line 334 of file Template.php.
References $blocks, $parent, and getParent().
Twig_Template::getBlocks | ( | ) |
Returns all blocks.
This method is for internal use only and should never be called directly.
Definition at line 396 of file Template.php.
References $blocks.
|
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.
array | $context | The context |
string | $item | The variable to return from the context |
bool | $ignoreStrictCheck | Whether to ignore the strict variable check or not |
Twig_Error_Runtime | if the variable does not exist and Twig is running in strict mode |
Definition at line 480 of file Template.php.
References getSourceContext().
Twig_Template::getDebugInfo | ( | ) |
Returns debug information about the template.
Definition at line 64 of file Template.php.
Twig_Template::getEnvironment | ( | ) |
Implements Twig_TemplateInterface.
Definition at line 96 of file Template.php.
References $env.
Twig_Template::getParent | ( | array | $context | ) |
Returns the parent template.
This method is for internal use only and should never be called directly.
array | $context |
Definition at line 115 of file Template.php.
References $parent, doGetParent(), Twig_Error\guess(), loadTemplate(), and Twig_Error\setSourceContext().
Referenced by displayBlock(), displayParentBlock(), getBlockNames(), and hasBlock().
Twig_Template::getSource | ( | ) |
Returns the template source code.
Definition at line 76 of file Template.php.
Twig_Template::getSourceContext | ( | ) |
Returns information about the original template source code.
Definition at line 88 of file Template.php.
References getTemplateName().
Referenced by displayParentBlock(), displayWithErrorHandling(), getAttribute(), getContext(), and loadTemplate().
|
abstract |
Returns the template name.
Referenced by __toString(), displayBlock(), getAttribute(), and getSourceContext().
Twig_Template::hasBlock | ( | $name, | |
array | $context = null , |
||
array | $blocks = array() |
||
) |
Returns whether a block exists or not in the current context of the template.
This method checks blocks defined in the current template or defined in "used" traits or defined in parent templates.
string | $name | The block name |
array | $context | The context |
array | $blocks | The current set of blocks |
Definition at line 298 of file Template.php.
References $blocks, $name, $parent, and getParent().
Twig_Template::isTraitable | ( | ) |
Definition at line 150 of file Template.php.
|
protected |
Definition at line 351 of file Template.php.
References $index, $template, getSourceContext(), Twig_Error\getSourceContext(), Twig_Error\getTemplateLine(), Twig_Error\guess(), Twig_Error\setSourceContext(), and Twig_Error\setTemplateLine().
Referenced by getParent(), and Twig_Tests_Node_ModuleTest\getTests().
Twig_Template::render | ( | array | $context | ) |
Renders the template with the given context and returns it as string.
array | $context | An array of parameters to pass to the template |
Implements Twig_TemplateInterface.
Definition at line 406 of file Template.php.
References display().
Twig_Template::renderBlock | ( | $name, | |
array | $context, | ||
array | $blocks = array() , |
||
$useBlocks = true |
|||
) |
Renders a block.
This method is for internal use only and should never be called directly.
string | $name | The block name to render |
array | $context | The context |
array | $blocks | The current set of blocks |
bool | $useBlocks | Whether to use the current set of blocks |
Definition at line 276 of file Template.php.
References $blocks, $name, and displayBlock().
Twig_Template::renderParentBlock | ( | $name, | |
array | $context, | ||
array | $blocks = array() |
||
) |
Renders a parent block.
This method is for internal use only and should never be called directly.
string | $name | The block name to render from the parent |
array | $context | The context |
array | $blocks | The current set of blocks |
Definition at line 253 of file Template.php.
References $blocks, $name, and displayParentBlock().
|
protected |
Definition at line 34 of file Template.php.
Referenced by display(), displayBlock(), displayParentBlock(), displayWithErrorHandling(), getBlockNames(), getBlocks(), hasBlock(), renderBlock(), and renderParentBlock().
|
staticprotected |
Definition at line 29 of file Template.php.
Referenced by getAttribute().
|
protected |
Definition at line 33 of file Template.php.
Referenced by __construct(), and getEnvironment().
|
protected |
Definition at line 31 of file Template.php.
Referenced by displayBlock(), displayParentBlock(), getBlockNames(), getParent(), and hasBlock().
|
protected |
Definition at line 32 of file Template.php.
|
protected |
Definition at line 35 of file Template.php.