W3cubDocs

/Symfony 4.1

SubmitButtonBuilder

class SubmitButtonBuilder extends ButtonBuilder

A builder for {@link SubmitButton} instances.

Properties

protected bool $locked from ButtonBuilder

Methods

__construct(string|null $name, array $options = array()) from ButtonBuilder
FormBuilderInterface add(string|int|FormBuilderInterface $child, string|null $type = null, array $options = array())

Unsupported method.

from ButtonBuilder
FormBuilderInterface create(string $name, string|null $type = null, array $options = array())

Unsupported method.

from ButtonBuilder
FormBuilderInterface get(string $name)

Unsupported method.

from ButtonBuilder
FormBuilderInterface remove(string $name)

Unsupported method.

from ButtonBuilder
bool has(string $name)

Unsupported method.

from ButtonBuilder
array all()

Returns the children.

from ButtonBuilder
FormInterface getForm()

Creates the button.

$this addEventListener(string $eventName, callable $listener, int $priority = 0)

Unsupported method.

from ButtonBuilder
$this addEventSubscriber(EventSubscriberInterface $subscriber)

Unsupported method.

from ButtonBuilder
$this addViewTransformer(DataTransformerInterface $viewTransformer, bool $forcePrepend = false)

Unsupported method.

from ButtonBuilder
$this resetViewTransformers()

Unsupported method.

from ButtonBuilder
$this addModelTransformer(DataTransformerInterface $modelTransformer, bool $forceAppend = false)

Unsupported method.

from ButtonBuilder
$this resetModelTransformers()

Unsupported method.

from ButtonBuilder
$this setAttribute(string $name, mixed $value)

Sets the value for an attribute.

from ButtonBuilder
$this setAttributes(array $attributes)

Sets the attributes.

from ButtonBuilder
$this setDataMapper(DataMapperInterface $dataMapper = null)

Unsupported method.

from ButtonBuilder
$this setDisabled(bool $disabled)

Set whether the button is disabled.

from ButtonBuilder
$this setEmptyData(mixed $emptyData)

Unsupported method.

from ButtonBuilder
$this setErrorBubbling(bool $errorBubbling)

Unsupported method.

from ButtonBuilder
$this setRequired(bool $required)

Unsupported method.

from ButtonBuilder
$this setPropertyPath(string|PropertyPathInterface|null $propertyPath)

Unsupported method.

from ButtonBuilder
$this setMapped(bool $mapped)

Unsupported method.

from ButtonBuilder
$this setByReference(bool $byReference)

Unsupported method.

from ButtonBuilder
$this setCompound(bool $compound)

Unsupported method.

from ButtonBuilder
$this setType(ResolvedFormTypeInterface $type)

Sets the type of the button.

from ButtonBuilder
$this setData(mixed $data)

Unsupported method.

from ButtonBuilder
$this setDataLocked(bool $locked)

Unsupported method.

from ButtonBuilder
setFormFactory(FormFactoryInterface $formFactory)

Unsupported method.

from ButtonBuilder
$this setAction(string $action)

Unsupported method.

from ButtonBuilder
$this setMethod(string $method)

Unsupported method.

from ButtonBuilder
$this setRequestHandler(RequestHandlerInterface $requestHandler)

Unsupported method.

from ButtonBuilder
$this setAutoInitialize(bool $initialize)

Unsupported method.

from ButtonBuilder
$this setInheritData(bool $inheritData)

Unsupported method.

from ButtonBuilder
FormConfigInterface getFormConfig()

Builds and returns the button configuration.

from ButtonBuilder
EventDispatcherInterface getEventDispatcher()

Unsupported method.

from ButtonBuilder
string getName()

Returns the name of the form used as HTTP parameter.

from ButtonBuilder
PropertyPathInterface|null getPropertyPath()

Unsupported method.

from ButtonBuilder
bool getMapped()

Unsupported method.

from ButtonBuilder
bool getByReference()

Unsupported method.

from ButtonBuilder
bool getCompound()

Unsupported method.

from ButtonBuilder
ResolvedFormTypeInterface getType()

Returns the form type used to construct the button.

from ButtonBuilder
DataTransformerInterface[] getViewTransformers()

Unsupported method.

from ButtonBuilder
DataTransformerInterface[] getModelTransformers()

Unsupported method.

from ButtonBuilder
DataMapperInterface|null getDataMapper()

Unsupported method.

from ButtonBuilder
bool getRequired()

Unsupported method.

from ButtonBuilder
bool getDisabled()

Returns whether the button is disabled.

from ButtonBuilder
bool getErrorBubbling()

Unsupported method.

from ButtonBuilder
mixed getEmptyData()

Unsupported method.

from ButtonBuilder
array getAttributes()

Returns additional attributes of the button.

from ButtonBuilder
bool hasAttribute(string $name)

Returns whether the attribute with the given name exists.

from ButtonBuilder
mixed getAttribute(string $name, mixed $default = null)

Returns the value of the given attribute.

from ButtonBuilder
mixed getData()

Unsupported method.

from ButtonBuilder
string|null getDataClass()

Unsupported method.

from ButtonBuilder
bool getDataLocked()

Unsupported method.

from ButtonBuilder
FormFactoryInterface getFormFactory()

Unsupported method.

from ButtonBuilder
string getAction()

Unsupported method.

from ButtonBuilder
string getMethod()

Unsupported method.

from ButtonBuilder
RequestHandlerInterface getRequestHandler()

Unsupported method.

from ButtonBuilder
bool getAutoInitialize()

Unsupported method.

from ButtonBuilder
bool getInheritData()

Unsupported method.

from ButtonBuilder
array getOptions()

Returns all options passed during the construction of the button.

from ButtonBuilder
bool hasOption(string $name)

Returns whether a specific option exists.

from ButtonBuilder
mixed getOption(string $name, mixed $default = null)

Returns the value of a specific option.

from ButtonBuilder
int count()

Unsupported method.

from ButtonBuilder
EmptyIterator getIterator()

Unsupported method.

from ButtonBuilder

Details

__construct(string|null $name, array $options = array())

Parameters

string|null $name
array $options

Exceptions

InvalidArgumentException if the name is empty

FormBuilderInterface add(string|int|FormBuilderInterface $child, string|null $type = null, array $options = array())

Unsupported method.

This method should not be invoked.

Parameters

string|int|FormBuilderInterface $child
string|null $type
array $options

Return Value

FormBuilderInterface

Exceptions

BadMethodCallException

FormBuilderInterface create(string $name, string|null $type = null, array $options = array())

Unsupported method.

This method should not be invoked.

Parameters

string $name The name of the form or the name of the property
string|null $type The type of the form or null if name is a property
array $options The options

Return Value

FormBuilderInterface

Exceptions

BadMethodCallException

FormBuilderInterface get(string $name)

Unsupported method.

This method should not be invoked.

Parameters

string $name The name of the child

Return Value

FormBuilderInterface

Exceptions

BadMethodCallException

FormBuilderInterface remove(string $name)

Unsupported method.

This method should not be invoked.

Parameters

string $name

Return Value

FormBuilderInterface

Exceptions

BadMethodCallException

bool has(string $name)

Unsupported method.

Parameters

string $name

Return Value

bool

array all()

Returns the children.

Return Value

array

FormInterface getForm()

Creates the button.

Return Value

FormInterface The form

$this addEventListener(string $eventName, callable $listener, int $priority = 0)

Unsupported method.

This method should not be invoked.

Parameters

string $eventName The name of the event to listen to
callable $listener The listener to execute
int $priority The priority of the listener. Listeners with a higher priority are called before listeners with a lower priority.

Return Value

$this The configuration object

Exceptions

BadMethodCallException

$this addEventSubscriber(EventSubscriberInterface $subscriber)

Unsupported method.

This method should not be invoked.

Parameters

EventSubscriberInterface $subscriber

Return Value

$this The configuration object

Exceptions

BadMethodCallException

$this addViewTransformer(DataTransformerInterface $viewTransformer, bool $forcePrepend = false)

Unsupported method.

This method should not be invoked.

Parameters

DataTransformerInterface $viewTransformer
bool $forcePrepend If set to true, prepend instead of appending

Return Value

$this The configuration object

Exceptions

BadMethodCallException

$this resetViewTransformers()

Unsupported method.

This method should not be invoked.

Return Value

$this The configuration object

Exceptions

BadMethodCallException

$this addModelTransformer(DataTransformerInterface $modelTransformer, bool $forceAppend = false)

Unsupported method.

This method should not be invoked.

Parameters

DataTransformerInterface $modelTransformer
bool $forceAppend If set to true, append instead of prepending

Return Value

$this The configuration object

Exceptions

BadMethodCallException

$this resetModelTransformers()

Unsupported method.

This method should not be invoked.

Return Value

$this The configuration object

Exceptions

BadMethodCallException

$this setAttribute(string $name, mixed $value)

Sets the value for an attribute.

Parameters

string $name The name of the attribute
mixed $value The value of the attribute

Return Value

$this The configuration object

$this setAttributes(array $attributes)

Sets the attributes.

Parameters

array $attributes

Return Value

$this The configuration object

$this setDataMapper(DataMapperInterface $dataMapper = null)

Unsupported method.

This method should not be invoked.

Parameters

DataMapperInterface $dataMapper

Return Value

$this The configuration object

Exceptions

BadMethodCallException

$this setDisabled(bool $disabled)

Set whether the button is disabled.

Parameters

bool $disabled Whether the form is disabled

Return Value

$this The configuration object

$this setEmptyData(mixed $emptyData)

Unsupported method.

This method should not be invoked.

Parameters

mixed $emptyData The empty data

Return Value

$this The configuration object

Exceptions

BadMethodCallException

$this setErrorBubbling(bool $errorBubbling)

Unsupported method.

This method should not be invoked.

Parameters

bool $errorBubbling

Return Value

$this The configuration object

Exceptions

BadMethodCallException

$this setRequired(bool $required)

Unsupported method.

This method should not be invoked.

Parameters

bool $required

Return Value

$this The configuration object

Exceptions

BadMethodCallException

$this setPropertyPath(string|PropertyPathInterface|null $propertyPath)

Unsupported method.

This method should not be invoked.

Parameters

string|PropertyPathInterface|null $propertyPath The property path or null if the path should be set automatically based on the form's name

Return Value

$this The configuration object

Exceptions

BadMethodCallException

$this setMapped(bool $mapped)

Unsupported method.

This method should not be invoked.

Parameters

bool $mapped Whether the form should be mapped

Return Value

$this The configuration object

Exceptions

BadMethodCallException

$this setByReference(bool $byReference)

Unsupported method.

This method should not be invoked.

Parameters

bool $byReference Whether the data should be modified by reference

Return Value

$this The configuration object

Exceptions

BadMethodCallException

$this setCompound(bool $compound)

Unsupported method.

This method should not be invoked.

Parameters

bool $compound Whether the form should be compound

Return Value

$this The configuration object

Exceptions

BadMethodCallException

$this setType(ResolvedFormTypeInterface $type)

Sets the type of the button.

Parameters

ResolvedFormTypeInterface $type

Return Value

$this The configuration object

$this setData(mixed $data)

Unsupported method.

This method should not be invoked.

Parameters

mixed $data The data of the form in application format

Return Value

$this The configuration object

Exceptions

BadMethodCallException

$this setDataLocked(bool $locked)

Unsupported method.

This method should not be invoked.

Parameters

bool $locked Whether to lock the default data

Return Value

$this The configuration object

Exceptions

BadMethodCallException

setFormFactory(FormFactoryInterface $formFactory)

Unsupported method.

This method should not be invoked.

Parameters

FormFactoryInterface $formFactory

Exceptions

BadMethodCallException

$this setAction(string $action)

Unsupported method.

Parameters

string $action The target URL of the form

Return Value

$this The configuration object

Exceptions

BadMethodCallException

$this setMethod(string $method)

Unsupported method.

Parameters

string $method The HTTP method of the form

Return Value

$this The configuration object

Exceptions

BadMethodCallException

$this setRequestHandler(RequestHandlerInterface $requestHandler)

Unsupported method.

Parameters

RequestHandlerInterface $requestHandler

Return Value

$this The configuration object

Exceptions

BadMethodCallException

$this setAutoInitialize(bool $initialize)

Unsupported method.

Parameters

bool $initialize true to initialize the form automatically, false to suppress automatic initialization. In the second case, you need to call {@link FormInterface::initialize()} manually

Return Value

$this The configuration object

Exceptions

BadMethodCallException

$this setInheritData(bool $inheritData)

Unsupported method.

Parameters

bool $inheritData Whether the form should inherit its parent's data

Return Value

$this The configuration object

Exceptions

BadMethodCallException

FormConfigInterface getFormConfig()

Builds and returns the button configuration.

Return Value

FormConfigInterface

EventDispatcherInterface getEventDispatcher()

Unsupported method.

Return Value

EventDispatcherInterface The dispatcher

string getName()

Returns the name of the form used as HTTP parameter.

Return Value

string The form name

PropertyPathInterface|null getPropertyPath()

Unsupported method.

Return Value

PropertyPathInterface|null The property path

bool getMapped()

Unsupported method.

Return Value

bool Whether the form is mapped

bool getByReference()

Unsupported method.

Return Value

bool Whether to modify the form's data by reference

bool getCompound()

Unsupported method.

Return Value

bool Whether the form is compound

ResolvedFormTypeInterface getType()

Returns the form type used to construct the button.

Return Value

ResolvedFormTypeInterface The form's type

DataTransformerInterface[] getViewTransformers()

Unsupported method.

Return Value

DataTransformerInterface[] An array of {@link DataTransformerInterface} instances

DataTransformerInterface[] getModelTransformers()

Unsupported method.

Return Value

DataTransformerInterface[] An array of {@link DataTransformerInterface} instances

DataMapperInterface|null getDataMapper()

Unsupported method.

Return Value

DataMapperInterface|null The data mapper

bool getRequired()

Unsupported method.

Return Value

bool Whether the form is required

bool getDisabled()

Returns whether the button is disabled.

Return Value

bool Whether the form is disabled

bool getErrorBubbling()

Unsupported method.

Return Value

bool Whether errors will bubble up

mixed getEmptyData()

Unsupported method.

Return Value

mixed The data returned if the form is empty

array getAttributes()

Returns additional attributes of the button.

Return Value

array An array of key-value combinations

bool hasAttribute(string $name)

Returns whether the attribute with the given name exists.

Parameters

string $name The attribute name

Return Value

bool Whether the attribute exists

mixed getAttribute(string $name, mixed $default = null)

Returns the value of the given attribute.

Parameters

string $name The attribute name
mixed $default The value returned if the attribute does not exist

Return Value

mixed The attribute value

mixed getData()

Unsupported method.

Return Value

mixed The initial form data

string|null getDataClass()

Unsupported method.

Return Value

string|null The data class or null

bool getDataLocked()

Unsupported method.

Return Value

bool Whether the data is locked

FormFactoryInterface getFormFactory()

Unsupported method.

Return Value

FormFactoryInterface The form factory

string getAction()

Unsupported method.

Return Value

string The target URL of the form

string getMethod()

Unsupported method.

Return Value

string The HTTP method of the form

RequestHandlerInterface getRequestHandler()

Unsupported method.

Return Value

RequestHandlerInterface The request handler

bool getAutoInitialize()

Unsupported method.

Return Value

bool returns true if the form should be initialized when created, false otherwise

bool getInheritData()

Unsupported method.

Return Value

bool Whether the form should inherit its parent's data

array getOptions()

Returns all options passed during the construction of the button.

Return Value

array The passed options

bool hasOption(string $name)

Returns whether a specific option exists.

Parameters

string $name The option name,

Return Value

bool Whether the option exists

mixed getOption(string $name, mixed $default = null)

Returns the value of a specific option.

Parameters

string $name The option name
mixed $default The value returned if the option does not exist

Return Value

mixed The option value

int count()

Unsupported method.

Return Value

int Always returns 0

EmptyIterator getIterator()

Unsupported method.

Return Value

EmptyIterator Always returns an empty iterator

© 2004–2017 Fabien Potencier
Licensed under the MIT License.
https://api.symfony.com/4.1/Symfony/Component/Form/SubmitButtonBuilder.html