lainchan/inc/lib/Twig/ExtensionInterface.php

84 lines
2.0 KiB
PHP
Raw Normal View History

2011-10-05 00:22:53 -04:00
<?php
/*
* This file is part of Twig.
*
* (c) 2009 Fabien Potencier
*
* 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 15:20:12 -04:00
* @author Fabien Potencier <fabien@symfony.com>
2011-10-05 00:22:53 -04:00
*/
interface Twig_ExtensionInterface
{
/**
* Initializes the runtime environment.
*
* This is where you can load some file that contains filter functions for instance.
*
* @param Twig_Environment $environment The current Twig_Environment instance
*/
2013-08-01 15:20:12 -04:00
public function initRuntime(Twig_Environment $environment);
2011-10-05 00:22:53 -04:00
/**
* Returns the token parser instances to add to the existing list.
*
* @return array An array of Twig_TokenParserInterface or Twig_TokenParserBrokerInterface instances
*/
2013-08-01 15:20:12 -04:00
public function getTokenParsers();
2011-10-05 00:22:53 -04:00
/**
* Returns the node visitor instances to add to the existing list.
*
* @return array An array of Twig_NodeVisitorInterface instances
*/
2013-08-01 15:20:12 -04:00
public function getNodeVisitors();
2011-10-05 00:22:53 -04:00
/**
* Returns a list of filters to add to the existing list.
*
* @return array An array of filters
*/
2013-08-01 15:20:12 -04:00
public function getFilters();
2011-10-05 00:22:53 -04:00
/**
* Returns a list of tests to add to the existing list.
*
* @return array An array of tests
*/
2013-08-01 15:20:12 -04:00
public function getTests();
2011-10-05 00:22:53 -04:00
/**
* Returns a list of functions to add to the existing list.
*
* @return array An array of functions
*/
2013-08-01 15:20:12 -04:00
public function getFunctions();
2011-10-05 00:22:53 -04:00
/**
* Returns a list of operators to add to the existing list.
*
* @return array An array of operators
*/
2013-08-01 15:20:12 -04:00
public function getOperators();
2011-10-05 00:22:53 -04:00
/**
2013-08-01 15:20:12 -04:00
* Returns a list of global variables to add to the existing list.
2011-10-05 00:22:53 -04:00
*
2013-08-01 15:20:12 -04:00
* @return array An array of global variables
2011-10-05 00:22:53 -04:00
*/
2013-08-01 15:20:12 -04:00
public function getGlobals();
2011-10-05 00:22:53 -04:00
/**
* Returns the name of the extension.
*
* @return string The extension name
*/
2013-08-01 15:20:12 -04:00
public function getName();
2011-10-05 00:22:53 -04:00
}