Symfony2 API
Class

Symfony\Component\Form\FormError

class FormError

Wraps errors in forms

Methods

__construct(string $message, string|null $messageTemplate = null, array $messageParameters = array(), integer|null $messagePluralization = null)

Constructor

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

integer|null getMessagePluralization()

Returns the value for error message pluralization.

Details

at line 58
public __construct(string $message, string|null $messageTemplate = null, array $messageParameters = array(), integer|null $messagePluralization = null)

Constructor

Any array key in $messageParameters will be used as a placeholder in
$messageTemplate.

Parameters

string $message The translated error message
string|null $messageTemplate The template for the error message
array $messageParameters The parameters that should be substituted in the message template.
integer|null $messagePluralization The value for error message pluralization

See also

\Symfony\Component\Translation\Translator

at line 71
public string getMessage()

Returns the error message

Return Value

string

at line 81
public string getMessageTemplate()

Returns the error message template

Return Value

string

at line 91
public array getMessageParameters()

Returns the parameters to be inserted in the message template

Return Value

array

at line 101
public integer|null getMessagePluralization()

Returns the value for error message pluralization.

Return Value

integer|null