src/Forms/CompositeField.php
public function getSchemaDataDefaults()
    {
        $defaults = parent::getSchemaDataDefaults();
        $children = $this->getChildren();
        if ($children && $children->count()) {
            $childSchema = [];
            /** @var FormField $child */
            foreach ($children as $child) {
                $childSchema[] = $child->getSchemaData();
            }
            $defaults['children'] = $childSchema;
        }

        $defaults['data']['tag'] = $this->getTag();
        $defaults['data']['legend'] = $this->getLegend();

        // Scaffolded children will inherit this data
        $defaults['data']['inherited'] = [
            'data' => [
                'fieldholder' => 'small'
            ],
        ];

        return $defaults;
    }
public function getSchemaDataDefaults()
    {
        $defaults = parent::getSchemaDataDefaults();
        $children = $this->getChildren();
        if ($children && $children->count()) {
            $childSchema = [];
            /** @var FormField $child */
            foreach ($children as $child) {
                $childSchema[] = $child->getSchemaData();
            }
            $defaults['children'] = $childSchema;
        }

        $defaults['data']['tag'] = $this->getTag();
        $defaults['data']['legend'] = $this->getLegend();

        // Scaffolded children will inherit this data
        $defaults['data']['inherited'] = [
            'data' => [
                'fieldholder' => 'small'
            ],
        ];

        return $defaults;
    }
public function getSchemaDataDefaults ( ) { $ defaults = parent :: getSchemaDataDefaults ( ) ; $ children = $ this -> getChildren ( ) ; if ( $ children && $ children -> count ( ) ) { $ childSchema = [ ] ; /** @var FormField $child */ foreach ( $ children as $ child ) { $ childSchema [ ] = $ child -> getSchemaData ( ) ; } $ defaults [ 'children' ] = $ childSchema ; } $ defaults [ 'data' ] [ 'tag' ] = $ this -> getTag ( ) ; $ defaults [ 'data' ] [ 'legend' ] = $ this -> getLegend ( ) ; // Scaffolded children will inherit this data $ defaults [ 'data' ] [ 'inherited' ] = [ 'data' => [ 'fieldholder' => 'small' ] , ] ; return $ defaults ; }
Merge child field data into this form
Merge child field data into this form