DOCS: Example should show how to disable VersionedGridfieldDetailForm as it's enabled by default

This commit is contained in:
mattclegg 2020-04-13 12:03:48 +05:45
parent 39fab1974a
commit 6a640f1498
No known key found for this signature in database
GPG Key ID: 68C4C8DB2D0D1DFE

View File

@ -269,19 +269,16 @@ the shortcode references the database identifier of the `Image` object.
### Controlling how CMS users interact with versioned DataObjects
By default the versioned module includes a `VersionedGridfieldDetailForm` that can extend gridfield with versioning support for models.
By default the versioned module includes a `VersionedGridfieldDetailForm` that extends gridfield with versioning support for DataObjects.
You can enable this on a per-model basis using the following code:
You can disable this on a per-model basis using the following code:
```php
<?php
use SilverStripe\ORM\DataObject;
use SilverStripe\Versioned\Versioned;
class MyBanner extends DataObject {
private static $extensions = [
Versioned::class,
];
private static $versioned_gridfield_extensions = true;
private static $versioned_gridfield_extensions = false;
}
```