Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions website/docs/advanced/custom-field-types.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ $view = new DataView([
'name' => 'string',
'price' => 'currency', // Custom type
],
]);
], $registry);
```

## Example: Slug Field
Expand Down Expand Up @@ -140,7 +140,7 @@ $view = new DataView([
'phone' => 'phone', // Custom type
'budget' => 'currency', // Custom type
],
]);
], $registry);
```

## Sharing Types Across Views
Expand All @@ -153,8 +153,8 @@ $registry = new \Tangible\DataView\FieldTypeRegistry();
$registry->register_type('phone', [...]);

// Use it for multiple views
$view1 = new DataView(['fields' => ['phone' => 'phone'], ...]);
$view2 = new DataView(['fields' => ['mobile' => 'phone'], ...]);
$view1 = new DataView(['fields' => ['phone' => 'phone'], ...], $registry);
$view2 = new DataView(['fields' => ['mobile' => 'phone'], ...], $registry);
```

## Database Schema Options
Expand Down