From: Fabien Potencier Date: Sun, 28 Nov 2010 12:53:37 +0000 (+0100) Subject: added Twig_Test_Method X-Git-Url: http://git.silmor.de/gitweb/?a=commitdiff_plain;h=5f0d582d1e3fa721b6e70841cd1755cdf7eba9c9;p=web%2Fkonrad%2Ftwig.git added Twig_Test_Method --- diff --git a/lib/Twig/Test/Method.php b/lib/Twig/Test/Method.php new file mode 100644 index 0000000..758321a --- /dev/null +++ b/lib/Twig/Test/Method.php @@ -0,0 +1,32 @@ + + */ +class Twig_Test_Method implements Twig_TestInterface +{ + protected $extension, $method; + + public function __construct(Twig_ExtensionInterface $extension, $method) + { + $this->extension = $extension; + $this->method = $method; + } + + public function compile() + { + return sprintf('$this->getEnvironment()->getExtension(\'%s\')->%s', $this->extension->getName(), $this->method); + } +}