Skip to content
PHP Ecosystem
Explore

Message

API reference › Inertia › Exception › Message

enumyii\inertia\Exception\Message
Backed bystring
Sourcesrc/Exception/Message.php

Defines exception message templates authored by the Yii2 Inertia adapter.

Use Message::getMessage() to format a template with sprintf() arguments.

CaseValueDescription
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.
MethodDescriptionDefined by
getMessage()Formats the message template with the supplied arguments.Message
public function getMessage(int|string ...$argument): string

Formats the message template with the supplied arguments.

Parameters

ParameterTypeDescription
...$argumentint|stringValues inserted into the template.

Returns

string: Formatted exception message.