# $productPage->toSafeHtmlString()

> String template builder with automatic HTML escaping, marking the result as trusted HTML for the Panel. Use this over `toSafeString()` whenever the result is rendered as HTML rather than used as plain text.

- Source: `src/Cms/ModelWithContent.php#L683` <https://github.com/getkirby/kirby/blob/6.0.0-beta.1/src/Cms/ModelWithContent.php#L683>
- Inherited from Kirby, not part of the Merx API. See <https://getkirby.com/docs/reference>.

```php
$productPage->toSafeHtmlString(null|string $template = null, array $data = [], null|string $fallback = ''): Kirby\Toolkit\HtmlString
```

## Parameters

| Name | Type | Default |
| --- | --- | --- |
| `$template` | `null\|string` | `null` |
| `$data` | `array` | `[]` |
| `$fallback` | `null\|string` | `''` |

## Return type

`Kirby\Toolkit\HtmlString`

## Parent class

`Wagnerwagner\Merx\ProductPage` inherited from `Kirby\Cms\ModelWithContent`
