# Message

> Defines locale URL exception message templates.

[API reference](/docs/api/index.md) › [Locale URLs](/docs/extensions/localeurls/reference/index.md) › [exception](/docs/extensions/localeurls/reference/exception/index.md) › Message

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

Defines locale URL exception message templates.

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

## Cases

| Case | Value | Description |
| --- | --- | --- |
| <span id="case-LOCALE_URLS_REQUIRE_PRETTY_URL"></span>`LOCALE_URLS_REQUIRE_PRETTY_URL` | `'Locale URL support requires enablePrettyUrl to be set to true.'` | Error when locale URLs are enabled while pretty URLs are disabled. |

## 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 ...$argument): string
```

Returns the formatted message string for the error case.

**Parameters**

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

**Returns**

`string`: Formatted error message with interpolated arguments.