# $field->toObject()

Parse yaml data and convert it to a content object

****

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

****

```php
$field->toObject(): Kirby\Content\Content
```

## Return type

`Kirby\Content\Content`

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


## Examples

This field method is intended for converting an `object` field to a content object.

```php
<?php if ($contact = $page->contact()->toObject()): ?>
<dl>
  <dt><?= Str::ucfirst($contact->photo()->key()) ?></dt>
  <dd><?= $contact->photo()?->toFile()->crop(200) ?></dd>
  <dt><?= Str::ucfirst($contact->name()->key()) ?></dt>
  <dd><?= $contact->name() ?></dd>
  <dt><?= Str::ucfirst($contact->email()->key()) ?></dt>
  <dd><?= $contact->email() ?></dd>
  <dt><?= Str::ucfirst($contact->phone()->key()) ?></dt>
  <dd><?= $contact->phone() ?></dd>
</dl>
<?php endif ?>
```