Message
API reference › Inertia › Exception › Message
Defines exception message templates authored by the Yii2 Inertia adapter.
Use Message::getMessage() to format a template with sprintf() arguments.
| Case | Value | Description |
|---|---|---|
APPLICATION_COMPONENT_INVALID | 'The "inertia" application component must be an instance of %s.' | The configured Inertia application component is invalid. |
ERROR_FLASH_INVALID | 'The Inertia error flash must be an array.' | The validation-error flash is not an array. |
ERROR_KEY_INVALID | 'Inertia error keys must be strings.' | A validation-error key is not a string. |
ERROR_MESSAGE_LIST_INVALID | 'Inertia error message lists must contain only strings.' | A validation-error message list contains a non-string value. |
ERROR_VALUE_INVALID | 'Inertia errors must contain strings or lists of strings.' | A validation-error value has an unsupported structure. |
SESSION_FLASH_KEY_INVALID | 'Inertia session flash keys must be strings.' | A session flash key is not a string. |
Methods
Section titled “Methods”| Method | Description | Defined by |
|---|---|---|
getMessage() | Formats the message template with the supplied arguments. | Message |
Method details
Section titled “Method details”getMessage()
Section titled “getMessage() ”public function getMessage(int|string ...$argument): stringFormats the message template with the supplied arguments.
Parameters
| Parameter | Type | Description |
|---|---|---|
...$argument | int| | Values inserted into the template. |
Returns
string: Formatted exception message.