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

Represents a template filter. More...

+ Inheritance diagram for Twig_Filter:
+ Collaboration diagram for Twig_Filter:

Public Member Functions

 __construct (array $options=array())
 
 setArguments ($arguments)
 
 getArguments ()
 
 needsEnvironment ()
 
 needsContext ()
 
 getSafe (Twig_Node $filterArgs)
 
 getPreservesSafety ()
 
 getPreEscape ()
 
 getCallable ()
 
- Public Member Functions inherited from Twig_FilterInterface
 compile ()
 Compiles a filter. More...
 
 needsEnvironment ()
 
 needsContext ()
 
 getSafe (Twig_Node $filterArgs)
 
 getPreservesSafety ()
 
 getPreEscape ()
 
 setArguments ($arguments)
 
 getArguments ()
 
 getCallable ()
 

Protected Attributes

 $options
 
 $arguments = array()
 

Detailed Description

Represents a template filter.

Use Twig_SimpleFilter instead.

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 23 of file Filter.php.

Constructor & Destructor Documentation

◆ __construct()

Twig_Filter::__construct ( array  $options = array())

Definition at line 28 of file Filter.php.

29 {
30 $this->options = array_merge(array(
31 'needs_environment' => false,
32 'needs_context' => false,
33 'pre_escape' => null,
34 'preserves_safety' => null,
35 'callable' => null,
36 ), $options);
37 }

References $options.

Member Function Documentation

◆ getArguments()

Twig_Filter::getArguments ( )

Implements Twig_FilterInterface.

Definition at line 44 of file Filter.php.

45 {
46 return $this->arguments;
47 }

References $arguments.

◆ getCallable()

Twig_Filter::getCallable ( )

Implements Twig_FilterCallableInterface.

Definition at line 80 of file Filter.php.

81 {
82 return $this->options['callable'];
83 }

◆ getPreEscape()

Twig_Filter::getPreEscape ( )

Implements Twig_FilterInterface.

Definition at line 75 of file Filter.php.

76 {
77 return $this->options['pre_escape'];
78 }

◆ getPreservesSafety()

Twig_Filter::getPreservesSafety ( )

Implements Twig_FilterInterface.

Definition at line 70 of file Filter.php.

71 {
72 return $this->options['preserves_safety'];
73 }

◆ getSafe()

Twig_Filter::getSafe ( Twig_Node  $filterArgs)

Implements Twig_FilterInterface.

Definition at line 59 of file Filter.php.

60 {
61 if (isset($this->options['is_safe'])) {
62 return $this->options['is_safe'];
63 }
64
65 if (isset($this->options['is_safe_callback'])) {
66 return call_user_func($this->options['is_safe_callback'], $filterArgs);
67 }
68 }

◆ needsContext()

Twig_Filter::needsContext ( )

Implements Twig_FilterInterface.

Definition at line 54 of file Filter.php.

55 {
56 return $this->options['needs_context'];
57 }

◆ needsEnvironment()

Twig_Filter::needsEnvironment ( )

Implements Twig_FilterInterface.

Definition at line 49 of file Filter.php.

50 {
51 return $this->options['needs_environment'];
52 }

◆ setArguments()

Twig_Filter::setArguments (   $arguments)

Implements Twig_FilterInterface.

Definition at line 39 of file Filter.php.

40 {
41 $this->arguments = $arguments;
42 }

References $arguments.

Field Documentation

◆ $arguments

Twig_Filter::$arguments = array()
protected

Definition at line 26 of file Filter.php.

Referenced by getArguments(), and setArguments().

◆ $options

Twig_Filter::$options
protected

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