Final Class Yiisoft\Mailer\View\MessageBodyTemplate
| Inheritance | Yiisoft\Mailer\View\MessageBodyTemplate |
|---|
Stores the path to the view file directory and the layout view names.
Public Properties
| Property | Type | Description | Defined By |
|---|---|---|---|
| $htmlLayout | string|null | Yiisoft\Mailer\View\MessageBodyTemplate | |
| $textLayout | string|null | Yiisoft\Mailer\View\MessageBodyTemplate | |
| $viewPath | string | Yiisoft\Mailer\View\MessageBodyTemplate |
Public Methods
| Method | Description | Defined By |
|---|---|---|
| __construct() | Yiisoft\Mailer\View\MessageBodyTemplate |
Property Details
Method Details
| public mixed __construct ( string $viewPath, string|null $htmlLayout = null, string|null $textLayout = null ) | ||
| $viewPath | string |
The directory containing view files for composing mail messages. |
| $htmlLayout | string|null |
The HTML layout view name. It is the relative to {@see $viewPath} path to file
with layout used to render HTML mail body, e.g., 'layouts/html'. If the value is |
| $textLayout | string|null |
The text layout view name. It is the relative to {@see $viewPath} path to file
with layout used to render text mail body, e.g., 'layouts/text'. If the value is |
public function __construct(
public readonly string $viewPath,
public readonly string|null $htmlLayout = null,
public readonly string|null $textLayout = null,
) {
if ($viewPath === '') {
throw new LogicException('View path must be non-empty string.');
}
if ($htmlLayout === '') {
throw new LogicException('The HTML layout view name must be non-empty string or null.');
}
if ($textLayout === '') {
throw new LogicException('The text layout view name must be non-empty string or null.');
}
}
Signup or Login in order to comment.