October: How to use a multidimensional array in fields.yaml?

Created on 9 Jul 2016  路  2Comments  路  Source: octobercms/october

How to use a multidimensional array in fields.yaml? For example I have $jsonable = ['data']. I want to write so (in fields.yaml):

fields:
 data[customization][colors][background]:
  label: Background
  type: colorpicker

The Repeater type doesn't approach, 褌.泻 it can create many identical fields.
Prompt as to solve it?

Most helpful comment

@Litvinenko Thanks for idea! I remade repeater and published on packagist.
Thanks. Closed

All 2 comments

@reg2005 e.g.:

data[extra]:
        label: 'extra'
        type: repeater
        form:
            fields:
                size:
                    label: 'size'
                    type: dropdown
                    options: getExtraSizeOptions
                    span: full
                comment:
                    label: 'comment'
                    type: markdown
                    size: small
                    span: full
                attachment[type]:
                    label: 'attachment type'
                    type: dropdown
                    span: full
                    options: getAttachmentTypeOptions
                attachment[image_url]:
                    label: 'image url'
                    type: mediafinder
                    mode: image
                    span: left
                    trigger:
                        action: show
                        field: attachment[type]
                        condition: value[image]
                attachment[is_circled]:
                    label: 'is circled'
                    type: checkbox
                    span: right
                    trigger:
                        action: show
                        field: attachment[type]
                        condition: value[image]
                attachment[video_code]:
                    label: 'video code'
                    type: textarea
                    size: small
                    span: full
                    trigger:
                        action: show
                        field: attachment[type]
                        condition: value[video]

@Litvinenko Thanks for idea! I remade repeater and published on packagist.
Thanks. Closed

Was this page helpful?
0 / 5 - 0 ratings

Related issues

lukaszbanas-extremecoding picture lukaszbanas-extremecoding  路  3Comments

LukeTowers picture LukeTowers  路  3Comments

mittultechnobrave picture mittultechnobrave  路  3Comments

mittultechnobrave picture mittultechnobrave  路  3Comments

mittultechnobrave picture mittultechnobrave  路  3Comments