Dotclear

source: inc/libs/twig/Test/Method.php @ 991:e42f791e0975

Revision 991:e42f791e0975, 748 bytes checked in by Dsls <dsls@…>, 13 years ago (diff)

New twig branch. 1st step : add twig 1.11.1

Line 
1<?php
2
3/*
4 * This file is part of Twig.
5 *
6 * (c) 2010 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/**
13 * Represents a method template test.
14 *
15 * @package    twig
16 * @author     Fabien Potencier <fabien@symfony.com>
17 */
18class Twig_Test_Method implements Twig_TestInterface
19{
20    protected $extension;
21    protected $method;
22
23    public function __construct(Twig_ExtensionInterface $extension, $method)
24    {
25        $this->extension = $extension;
26        $this->method = $method;
27    }
28
29    public function compile()
30    {
31        return sprintf('$this->env->getExtension(\'%s\')->%s', $this->extension->getName(), $this->method);
32    }
33}
Note: See TracBrowser for help on using the repository browser.

Sites map