mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
Merge pull request #9935 from manuth/patch-8
Update Dynamic_Default_Fields.md
This commit is contained in:
commit
d3e1678823
@ -8,7 +8,7 @@ summary: Learn how to add default values to your models
|
|||||||
## Static Default Values
|
## Static Default Values
|
||||||
The [DataObject::$defaults](api:SilverStripe\ORM\DataObject::$defaults) array allows you to specify simple static values to be the default values when a record is created.
|
The [DataObject::$defaults](api:SilverStripe\ORM\DataObject::$defaults) array allows you to specify simple static values to be the default values when a record is created.
|
||||||
|
|
||||||
A simple example is if you have a dog and by default it's bark is "Woof":
|
A simple example is if you have a dog and by default its bark is "Woof":
|
||||||
```php
|
```php
|
||||||
use SilverStripe\ORM\DataObject;
|
use SilverStripe\ORM\DataObject;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user