# Message

> Represents error message templates for exceptions thrown by the extension.

[API reference](/docs/api/index.md) › [Bootstrap 6](/docs/extensions/bootstrap6/reference/index.md) › [exception](/docs/extensions/bootstrap6/reference/exception/index.md) › Message

| enum | `yii2\extensions\bootstrap6\exception\Message` |
| --- | --- |
| Backed by | `string` |
| Source | [`src/exception/Message.php`](https://github.com/yii2-extensions/bootstrap6/blob/main/src/exception/Message.php#L14) |

Represents error message templates for exceptions thrown by the extension.

Use [`Message::getMessage()`](/docs/extensions/bootstrap6/reference/exception/message/index.md#method-getMessage) to format a template with `sprintf()` arguments.

## Cases

| Case | Value | Description |
| --- | --- | --- |
| <span id="case-INVALID_ITEMS"></span>`INVALID_ITEMS` | `"The 'items' option is required."` | Error when a widget requires a non-empty `items` option. |
| <span id="case-INVALID_VALUE"></span>`INVALID_VALUE` | `"Invalid value '%s' for '%s'. Allowed values: %s."` | Error when an option receives a value outside its allowed set. |
| <span id="case-ITEM_CONTENT_REQUIRED"></span>`ITEM_CONTENT_REQUIRED` | `"The 'content' option is required."` | Error when an item is missing its `content` option. |
| <span id="case-ITEM_LABEL_REQUIRED"></span>`ITEM_LABEL_REQUIRED` | `"The 'label' option is required."` | Error when an item is missing its `label` option. |
| <span id="case-MODULE_SCRIPT_UNAVAILABLE"></span>`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. |
| <span id="case-OPTION_REQUIRED"></span>`OPTION_REQUIRED` | `"The '%s' option is required."` | Error when a configuration array is missing a required option. |
| <span id="case-PACKAGE_VERSION_UNAVAILABLE"></span>`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. |
| <span id="case-PROPERTY_REQUIRED"></span>`PROPERTY_REQUIRED` | `"The '%s' property must be set."` | Error when a widget property that has no usable default is not set. |
| <span id="case-UNKNOWN_PLUGIN"></span>`UNKNOWN_PLUGIN` | `"Unknown Bootstrap plugin '%s'."` | Error when a widget registers a plugin that the Bootstrap bundle does not export. |

## Methods

| Method | Description | Defined by |
| --- | --- | --- |
| [`getMessage()`](#method-getMessage) | Returns the formatted message string for the error case. | `Message` |

## Method details

### getMessage() <span id="method-getMessage"></span>

```php
public function getMessage(int|string ...$args): string
```

Returns the formatted message string for the error case.

**Parameters**

| Parameter | Type | Description |
| --- | --- | --- |
| `...$args` | `int\|string` | Values to insert into the message template. |

**Returns**

`string`: Formatted error message with interpolated arguments.