ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
Twig_Test_Method Class Reference

Represents a method template test. More...

+ Inheritance diagram for Twig_Test_Method:
+ Collaboration diagram for Twig_Test_Method:

Public Member Functions

 __construct (Twig_ExtensionInterface $extension, $method, array $options=array())
 
 compile ()
 Compiles a test. More...
 
- Public Member Functions inherited from Twig_Test
 __construct (array $options=array())
 
 getCallable ()
 

Protected Attributes

 $extension
 
 $method
 
- Protected Attributes inherited from Twig_Test
 $options
 
 $arguments = array()
 

Detailed Description

Represents a method template test.

Author
Fabien Potencier fabie.nosp@m.n@sy.nosp@m.mfony.nosp@m..com
Deprecated:
since 1.12 (to be removed in 2.0)

Definition at line 21 of file Method.php.

Constructor & Destructor Documentation

◆ __construct()

Twig_Test_Method::__construct ( Twig_ExtensionInterface  $extension,
  $method,
array  $options = array() 
)

Definition at line 26 of file Method.php.

References $extension, $method, and Twig_Test\$options.

27  {
28  $options['callable'] = array($extension, $method);
29 
30  parent::__construct($options);
31 
32  $this->extension = $extension;
33  $this->method = $method;
34  }
$options
Definition: Test.php:23

Member Function Documentation

◆ compile()

Twig_Test_Method::compile ( )

Compiles a test.

Returns
string The PHP code for the test

Implements Twig_TestInterface.

Definition at line 36 of file Method.php.

37  {
38  return sprintf('$this->env->getExtension(\'%s\')->%s', get_class($this->extension), $this->method);
39  }

Field Documentation

◆ $extension

Twig_Test_Method::$extension
protected

Definition at line 23 of file Method.php.

Referenced by __construct().

◆ $method

Twig_Test_Method::$method
protected

Definition at line 24 of file Method.php.

Referenced by __construct().


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