class FormError implements Serializable
Wraps errors in forms.
| protected | $messageTemplate | ||
| protected | $messageParameters | ||
| protected | $messagePluralization |
| __construct(string|null $message, string $messageTemplate = null, array $messageParameters = array(), int $messagePluralization = null, mixed $cause = null) Any array key in $messageParameters will be used as a placeholder in $messageTemplate. | ||
| string | getMessage() Returns the error message. | |
| string | getMessageTemplate() Returns the error message template. | |
| array | getMessageParameters() Returns the parameters to be inserted in the message template. | |
| int|null | getMessagePluralization() Returns the value for error message pluralization. | |
| mixed | getCause() Returns the cause of this error. | |
| setOrigin(FormInterface $origin) Sets the form that caused this error. | ||
| FormInterface | getOrigin() Returns the form that caused this error. | |
| string | serialize() Serializes this error. | |
| unserialize(string $serialized) Unserializes a serialized error. |
Any array key in $messageParameters will be used as a placeholder in $messageTemplate.
| string|null | $message | The translated error message |
| string | $messageTemplate | The template for the error message |
| array | $messageParameters | The parameters that should be substituted in the message template |
| int | $messagePluralization | The value for error message pluralization |
| mixed | $cause | The cause of the error |
| Translator |
Returns the error message.
| string |
Returns the error message template.
| string |
Returns the parameters to be inserted in the message template.
| array |
Returns the value for error message pluralization.
| int|null |
Returns the cause of this error.
| mixed | The cause of this error |
Sets the form that caused this error.
This method must only be called once.
| FormInterface | $origin | The form that caused this error |
| BadMethodCallException | If the method is called more than once |
Returns the form that caused this error.
| FormInterface | The form that caused this error |
Serializes this error.
| string | The serialized error |
Unserializes a serialized error.
| string | $serialized | The serialized error |
© 2004–2017 Fabien Potencier
Licensed under the MIT License.
https://api.symfony.com/4.1/Symfony/Component/Form/FormError.html