mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 12:05:37 +00:00
Correcting docs around summary field relabelling
Although this is weird that it doesn't use the same logic and searchable fields.
This commit is contained in:
parent
7215637673
commit
1fb4c6f39f
@ -227,6 +227,32 @@ class MyDataObject extends DataObject
|
|||||||
|
|
||||||
```
|
```
|
||||||
|
|
||||||
|
In order to re-label any summary fields, you can use the $field_labels static.
|
||||||
|
|
||||||
|
```php
|
||||||
|
use SilverStripe\ORM\DataObject;
|
||||||
|
|
||||||
|
class MyDataObject extends DataObject
|
||||||
|
{
|
||||||
|
private static $db = [
|
||||||
|
'Name' => 'Text',
|
||||||
|
];
|
||||||
|
|
||||||
|
private static $has_one = [
|
||||||
|
'HeroImage' => 'Image',
|
||||||
|
];
|
||||||
|
|
||||||
|
private static $summary_fields = [
|
||||||
|
'Name',
|
||||||
|
'HeroImage.CMSThumbnail',
|
||||||
|
];
|
||||||
|
|
||||||
|
private static $field_labels = [
|
||||||
|
'Name' => 'Name',
|
||||||
|
'HeroImage.CMSThumbnail' => 'Hero',
|
||||||
|
];
|
||||||
|
}
|
||||||
|
|
||||||
## Related Documentation
|
## Related Documentation
|
||||||
|
|
||||||
* [SearchFilters](searchfilters)
|
* [SearchFilters](searchfilters)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user