ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
Twig_TemplateTest Class Reference
+ Inheritance diagram for Twig_TemplateTest:
+ Collaboration diagram for Twig_TemplateTest:

Public Member Functions

 __construct (Twig_Environment $env, $name='index.twig')
 
 getZero ()
 
 getEmpty ()
 
 getString ()
 
 getTrue ()
 
 getTemplateName ()
 Returns the template name. More...
 
 getDebugInfo ()
 Returns debug information about the template. More...
 
 getAttribute ($object, $item, array $arguments=array(), $type=Twig_Template::ANY_CALL, $isDefinedTest=false, $ignoreStrictCheck=false)
 Returns the attribute value for a given array/object. More...
 
 block_name ($context, array $blocks=array())
 
- Public Member Functions inherited from Twig_Template
 __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...
 
 render (array $context)
 Renders the template with the given context and returns it as string. More...
 
 display (array $context, array $blocks=array())
 Displays the template with the given context. More...
 
 getEnvironment ()
 Returns the bound environment for this template. More...
 

Protected Member Functions

 doGetParent (array $context)
 
 doDisplay (array $context, array $blocks=array())
 Auto-generated method to display the template with the given context. More...
 
- Protected Member Functions inherited from Twig_Template
 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...
 

Private Attributes

 $name
 

Additional Inherited Members

- Data Fields inherited from Twig_TemplateInterface
const ANY_CALL = 'any'
 
const ARRAY_CALL = 'array'
 
const METHOD_CALL = 'method'
 
- Protected Attributes inherited from Twig_Template
 $parent
 
 $parents = array()
 
 $env
 
 $blocks = array()
 
 $traits = array()
 
- Static Protected Attributes inherited from Twig_Template
static $cache = array()
 

Detailed Description

Definition at line 443 of file TemplateTest.php.

Constructor & Destructor Documentation

◆ __construct()

Twig_TemplateTest::__construct ( Twig_Environment  $env,
  $name = 'index.twig' 
)

Definition at line 447 of file TemplateTest.php.

448 {
449 parent::__construct($env);
450 self::$cache = array();
451 $this->name = $name;
452 }

References Twig_Template\$env, and $name.

Member Function Documentation

◆ block_name()

Twig_TemplateTest::block_name (   $context,
array  $blocks = array() 
)

Definition at line 502 of file TemplateTest.php.

503 {
504 }

◆ doDisplay()

Twig_TemplateTest::doDisplay ( array  $context,
array  $blocks = array() 
)
protected

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

Reimplemented from Twig_Template.

Definition at line 489 of file TemplateTest.php.

490 {
491 }

◆ doGetParent()

Twig_TemplateTest::doGetParent ( array  $context)
protected

Reimplemented from Twig_Template.

Definition at line 484 of file TemplateTest.php.

485 {
486 return false;
487 }

◆ getAttribute()

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

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_Template constants)
Parameters
bool$isDefinedTestWhether this is only a defined check
bool$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

Reimplemented from Twig_Template.

Definition at line 493 of file TemplateTest.php.

494 {
495 if (function_exists('twig_template_get_attributes')) {
496 return twig_template_get_attributes($this, $object, $item, $arguments, $type, $isDefinedTest, $ignoreStrictCheck);
497 } else {
498 return parent::getAttribute($object, $item, $arguments, $type, $isDefinedTest, $ignoreStrictCheck);
499 }
500 }
$type

References $type.

◆ getDebugInfo()

Twig_TemplateTest::getDebugInfo ( )

Returns debug information about the template.

Returns
array Debug information

Reimplemented from Twig_Template.

Definition at line 479 of file TemplateTest.php.

480 {
481 return array();
482 }

◆ getEmpty()

Twig_TemplateTest::getEmpty ( )

Definition at line 459 of file TemplateTest.php.

460 {
461 return '';
462 }

◆ getString()

Twig_TemplateTest::getString ( )

Definition at line 464 of file TemplateTest.php.

465 {
466 return 'some_string';
467 }

◆ getTemplateName()

Twig_TemplateTest::getTemplateName ( )

Returns the template name.

Returns
string The template name

Reimplemented from Twig_Template.

Definition at line 474 of file TemplateTest.php.

475 {
476 return $this->name;
477 }

References $name.

◆ getTrue()

Twig_TemplateTest::getTrue ( )

Definition at line 469 of file TemplateTest.php.

470 {
471 return true;
472 }

◆ getZero()

Twig_TemplateTest::getZero ( )

Definition at line 454 of file TemplateTest.php.

455 {
456 return 0;
457 }

Field Documentation

◆ $name

Twig_TemplateTest::$name
private

Definition at line 445 of file TemplateTest.php.

Referenced by __construct(), and getTemplateName().


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