Message
API reference › Bootstrap 6 › exception › Message
Represents error message templates for exceptions thrown by the extension.
Use Message::getMessage() to format a template with sprintf() arguments.
| Case | Value | Description |
|---|---|---|
INVALID_ITEMS | "The 'items' option is required." | Error when a widget requires a non-empty items option. |
INVALID_VALUE | "Invalid value '%s' for '%s'. Allowed values: %s." | Error when an option receives a value outside its allowed set. |
ITEM_CONTENT_REQUIRED | "The 'content' option is required." | Error when an item is missing its content option. |
ITEM_LABEL_REQUIRED | "The 'label' option is required." | Error when an item is missing its label option. |
MODULE_SCRIPT_UNAVAILABLE | "The asset bundle '%s' does not list a module script." | Error when an asset bundle lists no script to import as a module. |
OPTION_REQUIRED | "The '%s' option is required." | Error when a configuration array is missing a required option. |
PACKAGE_VERSION_UNAVAILABLE | "Unable to read the version of npm package '%s' from '%s'." | Error when the version of an npm package cannot be read for CDN delivery. |
PROPERTY_REQUIRED | "The '%s' property must be set." | Error when a widget property that has no usable default is not set. |
UNKNOWN_PLUGIN | "Unknown Bootstrap plugin '%s'." | Error when a widget registers a plugin that the Bootstrap bundle does not export. |
Methods
Section titled “Methods”| Method | Description | Defined by |
|---|---|---|
getMessage() | Returns the formatted message string for the error case. | Message |
Method details
Section titled “Method details”getMessage()
Section titled “getMessage() ”public function getMessage(int|string ...$args): stringReturns the formatted message string for the error case.
Parameters
| Parameter | Type | Description |
|---|---|---|
...$args | int| | Values to insert into the message template. |
Returns
string: Formatted error message with interpolated arguments.