ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
Twig_Function_Method Class Reference

Represents a method template function. More...

+ Inheritance diagram for Twig_Function_Method:
+ Collaboration diagram for Twig_Function_Method:

Public Member Functions

 __construct (Twig_ExtensionInterface $extension, $method, array $options=array())
 
 compile ()
 Compiles a function. More...
 
- Public Member Functions inherited from Twig_Function
 __construct (array $options=array())
 
 setArguments ($arguments)
 
 getArguments ()
 
 needsEnvironment ()
 
 needsContext ()
 
 getSafe (Twig_Node $functionArgs)
 
 getCallable ()
 

Protected Attributes

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

Detailed Description

Represents a method template function.

Use Twig_SimpleFunction instead.

Author
Arnaud Le Blanc arnau.nosp@m.d.lb.nosp@m.@gmai.nosp@m.l.co.nosp@m.m
Deprecated:
since 1.12 (to be removed in 2.0)

Definition at line 24 of file Method.php.

Constructor & Destructor Documentation

◆ __construct()

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

Definition at line 29 of file Method.php.

References $extension, $method, Twig_Function\$options, and array.

30  {
31  $options['callable'] = array($extension, $method);
32 
33  parent::__construct($options);
34 
35  $this->extension = $extension;
36  $this->method = $method;
37  }
Create styles array
The data for the language used.

Member Function Documentation

◆ compile()

Twig_Function_Method::compile ( )

Compiles a function.

Returns
string The PHP code for the function

Implements Twig_FunctionInterface.

Definition at line 39 of file Method.php.

40  {
41  return sprintf('$this->env->getExtension(\'%s\')->%s', get_class($this->extension), $this->method);
42  }

Field Documentation

◆ $extension

Twig_Function_Method::$extension
protected

Definition at line 26 of file Method.php.

Referenced by __construct().

◆ $method

Twig_Function_Method::$method
protected

Definition at line 27 of file Method.php.

Referenced by __construct().


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