Skip to content

Setup: ImportFilters

dante di domenico edited this page May 15, 2023 · 1 revision

Edit configuration

Import Filters configuration is used to setup import filters used in Import page. Each filter will be shown as a radio input, with its "options", if defined.

You can set Filters.Import in config/app_local.php (or in config/projects/<projectName>.php if you use multi project configuration).

Example for php file:

'Filters' => [
    'import' => [
        [
            'accept' => ['application/zip'],
            'name' => 'import-objects-from-zip',
            'label' => 'Import data from zip file',
            'class' => \Path\To\ZipImportFilter::class,
            'options' => [
                'uuid' => [
                    'dataType' => 'text',
                    'defaultValue' => '',
                    'label' => 'Uuid',
                ],
                'flag' => [
                    'dataType' => 'boolean',
                    'defaultValue' => true,
                    'label' => 'Flag',
                ],
                'opts' => [
                    'dataType' => 'options',
                    'defaultValue' => 1,
                    'label' => 'Options',
                    'values' => [
                        1 => 'one',
                        2 => 'two',
                        3 => 'three',
                    ],
                ],
            ],
        ],
    ],
],
Clone this wiki locally