ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
Method.php
Go to the documentation of this file.
1 <?php
2 
3 /*
4  * This file is part of Twig.
5  *
6  * (c) Fabien Potencier
7  *
8  * For the full copyright and license information, please view the LICENSE
9  * file that was distributed with this source code.
10  */
11 
12 @trigger_error('The Twig_Test_Method class is deprecated since version 1.12 and will be removed in 2.0. Use Twig_SimpleTest instead.', E_USER_DEPRECATED);
13 
22 {
23  protected $extension;
24  protected $method;
25 
26  public function __construct(Twig_ExtensionInterface $extension, $method, array $options = array())
27  {
28  $options['callable'] = array($extension, $method);
29 
30  parent::__construct($options);
31 
32  $this->extension = $extension;
33  $this->method = $method;
34  }
35 
36  public function compile()
37  {
38  return sprintf('$this->env->getExtension(\'%s\')->%s', get_class($this->extension), $this->method);
39  }
40 }
Interface implemented by extension classes.
Represents a template test.
Definition: Test.php:21
compile()
Compiles a test.
Definition: Method.php:36
Represents a method template test.
Definition: Method.php:21
$options
Definition: Test.php:23
__construct(Twig_ExtensionInterface $extension, $method, array $options=array())
Definition: Method.php:26