2011-10-05 06:22:53 +02:00
|
|
|
<?php
|
|
|
|
|
|
|
|
/*
|
|
|
|
* This file is part of Twig.
|
|
|
|
*
|
2018-05-10 12:24:53 +02:00
|
|
|
* (c) Fabien Potencier
|
2011-10-05 06:22:53 +02:00
|
|
|
*
|
|
|
|
* For the full copyright and license information, please view the LICENSE
|
|
|
|
* file that was distributed with this source code.
|
|
|
|
*/
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Interface implemented by extension classes.
|
|
|
|
*
|
2013-08-01 21:20:12 +02:00
|
|
|
* @author Fabien Potencier <fabien@symfony.com>
|
2011-10-05 06:22:53 +02:00
|
|
|
*/
|
|
|
|
interface Twig_ExtensionInterface
|
|
|
|
{
|
|
|
|
/**
|
|
|
|
* Initializes the runtime environment.
|
|
|
|
*
|
|
|
|
* This is where you can load some file that contains filter functions for instance.
|
|
|
|
*
|
2018-05-10 12:24:53 +02:00
|
|
|
* @deprecated since 1.23 (to be removed in 2.0), implement Twig_Extension_InitRuntimeInterface instead
|
2011-10-05 06:22:53 +02:00
|
|
|
*/
|
2013-08-01 21:20:12 +02:00
|
|
|
public function initRuntime(Twig_Environment $environment);
|
2011-10-05 06:22:53 +02:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Returns the token parser instances to add to the existing list.
|
|
|
|
*
|
2018-05-10 12:24:53 +02:00
|
|
|
* @return Twig_TokenParserInterface[]
|
2011-10-05 06:22:53 +02:00
|
|
|
*/
|
2013-08-01 21:20:12 +02:00
|
|
|
public function getTokenParsers();
|
2011-10-05 06:22:53 +02:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Returns the node visitor instances to add to the existing list.
|
|
|
|
*
|
2018-05-10 12:24:53 +02:00
|
|
|
* @return Twig_NodeVisitorInterface[]
|
2011-10-05 06:22:53 +02:00
|
|
|
*/
|
2013-08-01 21:20:12 +02:00
|
|
|
public function getNodeVisitors();
|
2011-10-05 06:22:53 +02:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Returns a list of filters to add to the existing list.
|
|
|
|
*
|
2018-05-10 12:24:53 +02:00
|
|
|
* @return Twig_SimpleFilter[]
|
2011-10-05 06:22:53 +02:00
|
|
|
*/
|
2013-08-01 21:20:12 +02:00
|
|
|
public function getFilters();
|
2011-10-05 06:22:53 +02:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Returns a list of tests to add to the existing list.
|
|
|
|
*
|
2018-05-10 12:24:53 +02:00
|
|
|
* @return Twig_SimpleTest[]
|
2011-10-05 06:22:53 +02:00
|
|
|
*/
|
2013-08-01 21:20:12 +02:00
|
|
|
public function getTests();
|
2011-10-05 06:22:53 +02:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Returns a list of functions to add to the existing list.
|
|
|
|
*
|
2018-05-10 12:24:53 +02:00
|
|
|
* @return Twig_SimpleFunction[]
|
2011-10-05 06:22:53 +02:00
|
|
|
*/
|
2013-08-01 21:20:12 +02:00
|
|
|
public function getFunctions();
|
2011-10-05 06:22:53 +02:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Returns a list of operators to add to the existing list.
|
|
|
|
*
|
2018-05-10 12:24:53 +02:00
|
|
|
* @return array<array> First array of unary operators, second array of binary operators
|
2011-10-05 06:22:53 +02:00
|
|
|
*/
|
2013-08-01 21:20:12 +02:00
|
|
|
public function getOperators();
|
2011-10-05 06:22:53 +02:00
|
|
|
|
|
|
|
/**
|
2013-08-01 21:20:12 +02:00
|
|
|
* Returns a list of global variables to add to the existing list.
|
2011-10-05 06:22:53 +02:00
|
|
|
*
|
2013-08-01 21:20:12 +02:00
|
|
|
* @return array An array of global variables
|
2018-05-10 12:24:53 +02:00
|
|
|
*
|
|
|
|
* @deprecated since 1.23 (to be removed in 2.0), implement Twig_Extension_GlobalsInterface instead
|
2011-10-05 06:22:53 +02:00
|
|
|
*/
|
2013-08-01 21:20:12 +02:00
|
|
|
public function getGlobals();
|
2011-10-05 06:22:53 +02:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Returns the name of the extension.
|
|
|
|
*
|
|
|
|
* @return string The extension name
|
2018-05-10 12:24:53 +02:00
|
|
|
*
|
|
|
|
* @deprecated since 1.26 (to be removed in 2.0), not used anymore internally
|
2011-10-05 06:22:53 +02:00
|
|
|
*/
|
2013-08-01 21:20:12 +02:00
|
|
|
public function getName();
|
2011-10-05 06:22:53 +02:00
|
|
|
}
|
2018-05-10 12:24:53 +02:00
|
|
|
|
|
|
|
class_alias('Twig_ExtensionInterface', 'Twig\Extension\ExtensionInterface', false);
|
|
|
|
class_exists('Twig_Environment');
|