Symfony\Bridge\Twig\Extension\CodeExtension
Twig extension relate to PHP code and used by the profiler and the default exception templates.
- Author: Fabien Potencier <fabien@symfony.com>
Synopsis
class CodeExtension
extends Twig_Extension
{
- // members
- private $fileLinkFormat;
- private $rootDir;
- private $charset;
- // methods
- public void __construct()
- public void getFilters()
- public void abbrClass()
- public void abbrMethod()
- public string formatArgs()
- public string formatArgsAsText()
- public string fileExcerpt()
- public string formatFile()
- public string getFileLink()
- public void formatFileFromText()
- public void getName()
- protected static void fixCodeMarkup()
- // Inherited methods from Twig_Extension
- public void initRuntime()
- public array getTokenParsers()
- public array getNodeVisitors()
- public array getFilters()
- public array getTests()
- public array getFunctions()
- public array getOperators()
- public array getGlobals()
Hierarchy
Extends
Members
private
- $charset
- $fileLinkFormat
- $rootDir
Methods
protected
public
- __construct() — Constructor.
- abbrClass()
- abbrMethod()
- fileExcerpt() — Returns an excerpt of a code file around the given line number.
- formatArgs() — Formats an array as a string.
- formatArgsAsText() — Formats an array as a string.
- formatFile() — Formats a file path.
- formatFileFromText()
- getFileLink() — Returns the link for a given file/line pair.
- getFilters() — {@inheritdoc}
- getName()
Inherited from Twig_Extension
public
- getFilters() — Returns a list of filters to add to the existing list.
- getFunctions() — Returns a list of functions to add to the existing list.
- getGlobals() — Returns a list of global variables to add to the existing list.
- getNodeVisitors() — Returns the node visitor instances to add to the existing list.
- getOperators() — Returns a list of operators to add to the existing list.
- getTests() — Returns a list of tests to add to the existing list.
- getTokenParsers() — Returns the token parser instances to add to the existing list.
- initRuntime() — Initializes the runtime environment.