classes/Fields/Listing.php
protected function getColumns($controller)
    {
        // If user has defined columns, use them
        if ($this->columns) {
            return $this->columns;
        }

        // Read columns from the controller
        $columns = $controller->columns();

        // If showing in sidebar, only show the first column
        // http://stackoverflow.com/a/1028677/59160
        if ($this->layout == 'sidebar') {
            $val = reset($columns); // Making sure this gets called before `key()`
            return [key($columns) => $val];

        // Otherwise, just return all columns
        }

        return $columns;
    }
protected function getColumns($controller)
    {
        // If user has defined columns, use them
        if ($this->columns) {
            return $this->columns;
        }

        // Read columns from the controller
        $columns = $controller->columns();

        // If showing in sidebar, only show the first column
        // http://stackoverflow.com/a/1028677/59160
        if ($this->layout == 'sidebar') {
            $val = reset($columns); // Making sure this gets called before `key()`
            return [key($columns) => $val];

        // Otherwise, just return all columns
        }

        return $columns;
    }
protected function getColumns ( $ controller ) { // If user has defined columns, use them if ( $ this -> columns ) { return $ this -> columns ; } // Read columns from the controller $ columns = $ controller -> columns ( ) ; // If showing in sidebar, only show the first column // http://stackoverflow.com/a/1028677/59160 if ( $ this -> layout == 'sidebar' ) { $ val = reset ( $ columns ) ; // Making sure this gets called before `key()` return [ key ( $ columns ) => $ val ] ; // Otherwise, just return all columns } return $ columns ; }
Get the list of columns of the controller

@param  Bkwld\Decoy\Controller\Base $controller A controller instance
@return array                       Associative array of column keys and values
Get the list of columns of the controller