src/Charcoal/Ui/Layout/LayoutTrait.php
public function setStructure(array $layouts)
    {
        $computedLayouts = [];
        foreach ($layouts as $l) {
            $loop = isset($l['loop']) ? (int)$l['loop'] : 1;
            unset($l['loop']);
            for ($i=0; $i<$loop; $i++) {
                $computedLayouts[] = $l;
            }
        }

        $this->structure = $computedLayouts;

        return $this;
    }
public function setStructure(array $layouts)
    {
        $computedLayouts = [];
        foreach ($layouts as $l) {
            $loop = isset($l['loop']) ? (int)$l['loop'] : 1;
            unset($l['loop']);
            for ($i=0; $i<$loop; $i++) {
                $computedLayouts[] = $l;
            }
        }

        $this->structure = $computedLayouts;

        return $this;
    }
public function setStructure ( array $ layouts ) { $ computedLayouts = [ ] ; foreach ( $ layouts as $ l ) { $ loop = isset ( $ l [ 'loop' ] ) ? ( int ) $ l [ 'loop' ] : 1 ; unset ( $ l [ 'loop' ] ) ; for ( $ i = 0 ; $ i < $ loop ; $ i ++ ) { $ computedLayouts [ ] = $ l ; } } $ this -> structure = $ computedLayouts ; return $ this ; }
Prepare the layouts configuration in a simpler, ready, data structure.

This function goes through the layout options to expand loops into extra layout data...

@param array $layouts The original layout data, typically from configuration.
@return array Computed layouts, ready for looping
Prepare the layouts configuration in a simpler ready data structure .