Use the media
type to link to a file in the media library.
Included in the PerformMediaBundle.
The label to use for form labels and table headings. If no label is provided, a sensible label will be created automatically.
This option is optional.
Allowed types: string
Defaults:
The type of media to choose from. Each entry should refer to the name of a plugin.
This option is optional.
Allowed types: array, string
Defaults:
[]
[]
[]
[]
If true, use the media selector modal to choose media.
You may use a bare string instead of an array to use only one plugin.
If no types are supplied, all media will be available.
This option is optional.
Allowed types: boolean
Defaults:
true
true
true
true
<?php
$config->add('image', [
'type' => 'media',
'options' => [
'types' => 'image',
// same as
// 'types' => ['image'],
],
'contexts' => [
CrudRequest::CONTEXT_LIST,
CrudRequest::CONTEXT_EDIT,
],
])