English (United Kingdom)

Displays a composite field to upload media files.

type

(string)  Must be equals to media.

label

(string)  The label to display next to the field.

help

(string)  An optional text to describe the purpose of the field.

required

(bool)  Whether the field is mandatory or optional.

value

(string|array)  The last uploaded file(s).

id

(string)  An optional field ID.

hidden

(bool)  True to avoid displaying the label of the field.

multiple

(bool)  Whether the field supports the upload of multiple files (false by default).

attributes

(array)  An associative array containing some additional attributes for the media manager.

Additional Attributes

placeholder

(string)  An optional placeholder to display when there are not selected files. If not specified, the default one will be used.

preview

(bool)  Whether the button to see a preview of the selected files should be displayed or not (enabled by default).

path

(string)  The path where the media files are located. If not specified, the default one will be used.

filter

(bool)  Whether the media manager accepts only images or also other extended files (only images by default).

icon

(string)  Used to customize the default icon of the button used to pick a media file.

modaltitle

(string)  Used to customize the default title of the media manager popup.

[
    'gallery' => [
        'type' => 'media',
        'label' => 'Gallery',
        'value' => ['image-1.png', 'image-2.png'],
        'multiple' => true,
    ]
]

Changelog

Version Description
1.3 Introduced.
Last Update: 2023-12-19
Helpful?