FormTypeCsrfExtension
extends AbstractTypeExtension
in package
Tags
Table of Contents
- $defaultEnabled : mixed
- $defaultFieldName : mixed
- $defaultTokenManager : mixed
- $serverParams : mixed
- $translationDomain : mixed
- $translator : mixed
- __construct() : mixed
- buildForm() : mixed
- Adds a CSRF field to the form when the CSRF protection is enabled.
- buildView() : mixed
- Builds the view.
- configureOptions() : mixed
- finishView() : mixed
- Adds a CSRF field to the root form view.
- getExtendedType() : string
- Returns the name of the type being extended.
- getExtendedTypes() : iteratable<string|int, mixed>
- {@inheritdoc}
Properties
$defaultEnabled
private
mixed
$defaultEnabled
$defaultFieldName
private
mixed
$defaultFieldName
$defaultTokenManager
private
mixed
$defaultTokenManager
$serverParams
private
mixed
$serverParams
$translationDomain
private
mixed
$translationDomain
$translator
private
mixed
$translator
Methods
__construct()
public
__construct(CsrfTokenManagerInterface $defaultTokenManager[, bool $defaultEnabled = true ][, string $defaultFieldName = '_token' ][, TranslatorInterface|null $translator = null ][, string $translationDomain = null ][, ServerParams $serverParams = null ]) : mixed
Parameters
- $defaultTokenManager : CsrfTokenManagerInterface
- $defaultEnabled : bool = true
- $defaultFieldName : string = '_token'
- $translator : TranslatorInterface|null = null
- $translationDomain : string = null
- $serverParams : ServerParams = null
Return values
mixed —buildForm()
Adds a CSRF field to the form when the CSRF protection is enabled.
public
buildForm(FormBuilderInterface $builder, array<string|int, mixed> $options) : mixed
Parameters
- $builder : FormBuilderInterface
- $options : array<string|int, mixed>
Return values
mixed —buildView()
Builds the view.
public
buildView(FormView $view, FormInterface $form, array<string|int, mixed> $options) : mixed
Parameters
- $view : FormView
- $form : FormInterface
- $options : array<string|int, mixed>
Return values
mixed —configureOptions()
public
configureOptions(OptionsResolver $resolver) : mixed
Parameters
- $resolver : OptionsResolver
Return values
mixed —finishView()
Adds a CSRF field to the root form view.
public
finishView(FormView $view, FormInterface $form, array<string|int, mixed> $options) : mixed
Parameters
- $view : FormView
- $form : FormInterface
- $options : array<string|int, mixed>
Return values
mixed —getExtendedType()
Returns the name of the type being extended.
public
getExtendedType() : string
Tags
Return values
string —The name of the type being extended
getExtendedTypes()
{@inheritdoc}
public
static getExtendedTypes() : iteratable<string|int, mixed>