# $field->replace()

It parses any queries found in the field value.

****

- Source: <https://github.com/getkirby/kirby/tree/5.5.3/config/methods.php#L548>

****

```php
$field->replace(array $data = [ ], string|null $fallback = ''): Kirby\Content\Field
```

## Parameters

| Name | Type | Default | Description |
| ---- | ---- | ---- | ---- |
| `$data` | `array` | `[ ]` | – |
| `$fallback` | `string` or `null` | `''` | Fallback for tokens in the template that cannot be replaced (`null` to keep the original token) |

## Return type

`Kirby\Content\Field`

This method modifies the existing `$field` object it is applied to and returns it again.


## Examples

Given the field contains string templates, use this method to replace them with values:

Example text:

```text
Text: The company behind {{ product }} and the responsible data controller for this website is the {{ company }}.
```

```php
<?= $page->text()->replace(
    [
        'company' => 'Content Folder GmbH & Co. KG',
        'product' => 'Kirby CMS'
    ]
);
```

Will result in

```
The company behind Kirby CMS and the responsible data controller for this website is the Content Folder GmbH & Co. KG.
```