public function insertFields($fields, $index)
    {
        if (!$fields instanceof NamedBuilder && !is_array($fields)) {
            return;
        }

        // If a singular field config, put into an array of fields
        if ($fields instanceof NamedBuilder) {
            $fields = [$fields];
        }


        foreach ($fields as $i => $field) {
            if ($this->validateField($field)) {
                array_splice($this->fields, $index + $i, 0, [$field]);
            }
        }
    }
public function insertFields($fields, $index)
    {
        if (!$fields instanceof NamedBuilder && !is_array($fields)) {
            return;
        }

        // If a singular field config, put into an array of fields
        if ($fields instanceof NamedBuilder) {
            $fields = [$fields];
        }


        foreach ($fields as $i => $field) {
            if ($this->validateField($field)) {
                array_splice($this->fields, $index + $i, 0, [$field]);
            }
        }
    }
public function insertFields ( $ fields , $ index ) { if ( ! $ fields instanceof NamedBuilder && ! is_array ( $ fields ) ) { return ; } // If a singular field config, put into an array of fields if ( $ fields instanceof NamedBuilder ) { $ fields = [ $ fields ] ; } foreach ( $ fields as $ i => $ field ) { if ( $ this -> validateField ( $ field ) ) { array_splice ( $ this -> fields , $ index + $ i , 0 , [ $ field ] ) ; } } }
Insert of field at a specific index
@param  NamedBuilder|NamedBuilder[] $fields a single field or an array of fields
@param  int $index  insertion point
@return void
Insert of field at a specific index