Documentation

EasyAdminTwigExtension extends AbstractExtension
in package
implements GlobalsInterface

Defines the filters and functions used to render the bundle's templates.

Also injects the admin context into Twig global variables as ea in order to be used by admin templates.

Tags
author

Javier Eguiluz javier.eguiluz@gmail.com

Table of Contents

Interfaces

GlobalsInterface
Enables usage of the deprecated Twig\Extension\AbstractExtension::getGlobals() method.

Properties

$adminContextProvider  : AdminContextProvider
$csrfTokenManager  : CsrfTokenManagerInterface|null
$serviceLocator  : ServiceLocator

Methods

__construct()  : mixed
applyFilterIfExists()  : mixed
callFunctionIfExists()  : mixed
createFieldLayout()  : FieldLayoutDto
fileSize()  : string
flattenArray()  : array<string|int, mixed>
Transforms ['a' => 'foo', 'b' => ['c' => ['d' => 7]]] into ['a' => 'foo', 'b[c][d]' => 7] It's useful to submit nested arrays (e.g. query string parameters) as form fields.
getAdminUrlGenerator()  : AdminUrlGenerator
getFilters()  : array<string|int, TwigFilter>
Returns a list of filters to add to the existing list.
getFunctions()  : array<string|int, TwigFunction>
Returns a list of functions to add to the existing list.
getGlobals()  : array<string, mixed>
getNodeVisitors()  : array<string|int, NodeVisitorInterface>
Returns the node visitor instances to add to the existing list.
getOperators()  : array<string|int, array<string|int, mixed>>
Returns a list of operators to add to the existing list.
getTests()  : array<string|int, TwigTest>
Returns a list of tests to add to the existing list.
getTokenParsers()  : array<string|int, TokenParserInterface>
Returns the token parser instances to add to the existing list.
renderCsrfToken()  : string
Needed to avoid errors when calling 'csrf_token()' in Twig templates of applications that disabled CSRF protection.
representAsString()  : string

Properties

Methods

applyFilterIfExists()

public applyFilterIfExists(Environment $environment, mixed $value, string $filterName, mixed ...$filterArguments) : mixed
Parameters
$environment : Environment
$value : mixed
$filterName : string
$filterArguments : mixed

callFunctionIfExists()

public callFunctionIfExists(Environment $environment, string $functionName, mixed ...$functionArguments) : mixed
Parameters
$environment : Environment
$functionName : string
$functionArguments : mixed

flattenArray()

Transforms ['a' => 'foo', 'b' => ['c' => ['d' => 7]]] into ['a' => 'foo', 'b[c][d]' => 7] It's useful to submit nested arrays (e.g. query string parameters) as form fields.

public flattenArray(mixed $array[, mixed $parentKey = null ]) : array<string|int, mixed>
Parameters
$array : mixed
$parentKey : mixed = null
Return values
array<string|int, mixed>

getOperators()

Returns a list of operators to add to the existing list.

public getOperators() : array<string|int, array<string|int, mixed>>
Return values
array<string|int, array<string|int, mixed>>

First array of unary operators, second array of binary operators

renderCsrfToken()

Needed to avoid errors when calling 'csrf_token()' in Twig templates of applications that disabled CSRF protection.

public renderCsrfToken(string $tokenId) : string
Parameters
$tokenId : string
Return values
string

representAsString()

public representAsString(mixed $value) : string
Parameters
$value : mixed
Return values
string

        
On this page

Search results