W3cubDocs

/Symfony 2.7

Symfony\Component\Form\SubmitButton

class SubmitButton extends Button implements ClickableInterface

A button that submits the form.

Methods

__construct(FormConfigInterface $config)

Creates a new button from a form configuration.

from Button
bool offsetExists(mixed $offset)

Unsupported method.

from Button
offsetGet(mixed $offset)

Unsupported method.

from Button
offsetSet(mixed $offset, mixed $value)

Unsupported method.

from Button
offsetUnset(mixed $offset)

Unsupported method.

from Button
FormInterface setParent(FormInterface $parent = null)

Sets the parent form.

from Button
FormInterface|null getParent()

Returns the parent form.

from Button
FormInterface add(int|string|FormInterface $child, null $type = null, array $options = array())

Unsupported method.

from Button
FormInterface get(string $name)

Unsupported method.

from Button
bool has(string $name)

Unsupported method.

from Button
FormInterface remove(string $name)

Unsupported method.

from Button
FormInterface[] all()

Returns all children in this group.

from Button
FormErrorIterator getErrors(bool $deep = false, bool $flatten = true)

Returns the errors of this form.

from Button
FormInterface setData(string $modelData)

Unsupported method.

from Button
null getData()

Unsupported method.

from Button
null getNormData()

Unsupported method.

from Button
null getViewData()

Unsupported method.

from Button
array getExtraData()

Unsupported method.

from Button
FormConfigInterface getConfig()

Returns the button's configuration.

from Button
bool isSubmitted()

Returns whether the button is submitted.

from Button
string getName()

Returns the name by which the button is identified in forms.

from Button
null getPropertyPath()

Unsupported method.

from Button
FormInterface addError(FormError $error)

Unsupported method.

from Button
bool isValid()

Unsupported method.

from Button
bool isRequired()

Unsupported method.

from Button
bool isDisabled()

Returns whether this form is disabled.

from Button
bool isEmpty()

Unsupported method.

from Button
bool isSynchronized()

Unsupported method.

from Button
null getTransformationFailure()

Unsupported method.

from Button
FormInterface initialize()

Unsupported method.

from Button
FormInterface handleRequest(mixed $request = null)

Unsupported method.

from Button
SubmitButton submit(null|string $submittedData, bool $clearMissing = true)

Submits data to the button.

FormInterface getRoot()

Returns the root of the form tree.

from Button
bool isRoot()

Returns whether the field is the root of the form tree.

from Button
FormView createView(FormView $parent = null)

Creates a view.

from Button
int count()

Unsupported method.

from Button
EmptyIterator getIterator()

Unsupported method.

from Button
bool isClicked()

Returns whether this element was clicked.

Details

public __construct(FormConfigInterface $config)

Creates a new button from a form configuration.

Parameters

FormConfigInterface $config The button's configuration.

public bool offsetExists(mixed $offset)

Unsupported method.

Parameters

mixed $offset

Return Value

bool Always returns false.

public offsetGet(mixed $offset)

Unsupported method.

This method should not be invoked.

Parameters

mixed $offset

Exceptions

BadMethodCallException

public offsetSet(mixed $offset, mixed $value)

Unsupported method.

This method should not be invoked.

Parameters

mixed $offset
mixed $value

Exceptions

BadMethodCallException

public offsetUnset(mixed $offset)

Unsupported method.

This method should not be invoked.

Parameters

mixed $offset

Exceptions

BadMethodCallException

public FormInterface setParent(FormInterface $parent = null)

Sets the parent form.

Parameters

FormInterface $parent The parent form or null if it's the root.

Return Value

FormInterface The form instance

Exceptions

AlreadySubmittedException If the form has already been submitted.
LogicException When trying to set a parent for a form with an empty name.

public FormInterface|null getParent()

Returns the parent form.

Return Value

FormInterface|null The parent form or null if there is none.

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

Unsupported method.

This method should not be invoked.

Parameters

int|string|FormInterface $child The FormInterface instance or the name of the child.
null $type The child's type, if a name was passed.
array $options The child's options, if a name was passed.

Return Value

FormInterface The form instance

Exceptions

BadMethodCallException

public FormInterface get(string $name)

Unsupported method.

This method should not be invoked.

Parameters

string $name The name of the child

Return Value

FormInterface The child form

Exceptions

BadMethodCallException

public bool has(string $name)

Unsupported method.

Parameters

string $name The name of the child

Return Value

bool Always returns false.

public FormInterface remove(string $name)

Unsupported method.

This method should not be invoked.

Parameters

string $name The name of the child to remove

Return Value

FormInterface The form instance

Exceptions

BadMethodCallException

public FormInterface[] all()

Returns all children in this group.

Return Value

FormInterface[] An array of FormInterface instances

public FormErrorIterator getErrors(bool $deep = false, bool $flatten = true)

Returns the errors of this form.

Parameters

bool $deep Whether to include errors of child forms as well
bool $flatten Whether to flatten the list of errors in case $deep is set to true

Return Value

FormErrorIterator An iterator over the {@link FormError} instances that where added to this form

public FormInterface setData(string $modelData)

Unsupported method.

This method should not be invoked.

Parameters

string $modelData The data formatted as expected for the underlying object

Return Value

FormInterface The form instance

Exceptions

BadMethodCallException

public null getData()

Unsupported method.

Return Value

null Always returns null.

public null getNormData()

Unsupported method.

Return Value

null Always returns null.

public null getViewData()

Unsupported method.

Return Value

null Always returns null.

public array getExtraData()

Unsupported method.

Return Value

array Always returns an empty array.

public FormConfigInterface getConfig()

Returns the button's configuration.

Return Value

FormConfigInterface The configuration.

public bool isSubmitted()

Returns whether the button is submitted.

Return Value

bool true if the button was submitted.

public string getName()

Returns the name by which the button is identified in forms.

Return Value

string The name of the button.

public null getPropertyPath()

Unsupported method.

Return Value

null Always returns null.

public FormInterface addError(FormError $error)

Unsupported method.

Parameters

FormError $error

Return Value

FormInterface The form instance

Exceptions

BadMethodCallException

public bool isValid()

Unsupported method.

Return Value

bool Always returns true.

public bool isRequired()

Unsupported method.

Return Value

bool Always returns false.

public bool isDisabled()

Returns whether this form is disabled.

The content of a disabled form is displayed, but not allowed to be modified. The validation of modified disabled forms should fail.

Forms whose parents are disabled are considered disabled regardless of their own state.

Return Value

bool

public bool isEmpty()

Unsupported method.

Return Value

bool Always returns true.

public bool isSynchronized()

Unsupported method.

Return Value

bool Always returns true.

public null getTransformationFailure()

Unsupported method.

Return Value

null Always returns null

public FormInterface initialize()

Unsupported method.

Return Value

FormInterface The form instance.

Exceptions

BadMethodCallException

public FormInterface handleRequest(mixed $request = null)

Unsupported method.

Parameters

mixed $request The request to handle.

Return Value

FormInterface The form instance.

Exceptions

BadMethodCallException

public SubmitButton submit(null|string $submittedData, bool $clearMissing = true)

Submits data to the button.

Parameters

null|string $submittedData The data.
bool $clearMissing Not used.

Return Value

SubmitButton The button instance

Exceptions

AlreadySubmittedException If the form has already been submitted.

public FormInterface getRoot()

Returns the root of the form tree.

Return Value

FormInterface The root of the tree

public bool isRoot()

Returns whether the field is the root of the form tree.

Return Value

bool

public FormView createView(FormView $parent = null)

Creates a view.

Parameters

FormView $parent The parent view

Return Value

FormView The view

public int count()

Unsupported method.

Return Value

int Always returns 0.

public EmptyIterator getIterator()

Unsupported method.

Return Value

EmptyIterator Always returns an empty iterator.

public bool isClicked()

Returns whether this element was clicked.

Return Value

bool Whether this element was clicked.

© 2004–2016 Fabien Potencier
Licensed under the MIT License.
http://api.symfony.com/2.7/Symfony/Component/Form/SubmitButton.html