class CodeExtension extends Twig_Extension
Twig extension relate to PHP code and used by the profiler and the default exception templates.
__construct(string|FileLinkFormatter $fileLinkFormat, string $rootDir, string $charset) Constructor. | ||
getFilters() {@inheritdoc} | ||
abbrClass($class) | ||
abbrMethod($method) | ||
string | formatArgs(array $args) Formats an array as a string. | |
string | formatArgsAsText(array $args) Formats an array as a string. | |
string | fileExcerpt(string $file, int $line, int $srcContext = 3) Returns an excerpt of a code file around the given line number. | |
string | formatFile(string $file, int $line, string $text = null) Formats a file path. | |
string | getFileLink(string $file, int $line) Returns the link for a given file/line pair. | |
formatFileFromText($text) | ||
formatLogMessage($message, array $context) | ||
getName() {@inheritdoc} |
Constructor.
{@inheritdoc}
Formats an array as a string.
Formats an array as a string.
Returns an excerpt of a code file around the given line number.
Formats a file path.
Returns the link for a given file/line pair.
{@inheritdoc}
© 2004–2016 Fabien Potencier
Licensed under the MIT License.
http://api.symfony.com/3.2/Symfony/Bridge/Twig/Extension/CodeExtension.html