Overview

Namespaces

  • Charcoal
    • Ui
      • Dashboard
      • Form
      • FormGroup
      • FormInput
      • Layout
      • Menu
      • MenuItem
      • ServiceProvider

Classes

  • AbstractLayout
  • GenericLayout
  • LayoutBuilder
  • LayoutConfig
  • LayoutFactory

Interfaces

  • LayoutAwareInterface
  • LayoutInterface

Traits

  • LayoutAwareTrait
  • LayoutTrait
  • Overview
  • Namespace
  • Class

Trait LayoutTrait

Provides an implementation of Charcoal\Ui\Layout\LayoutInterface.

Direct Known Users

Charcoal\Ui\Layout\AbstractLayout

Indirect Known Users

Charcoal\Ui\Layout\GenericLayout
Namespace: Charcoal\Ui\Layout
Located at Charcoal/Ui/Layout/LayoutTrait.php
Methods summary
public Charcoal\Ui\Layout\LayoutInterface
# setPosition( integer $position )

Parameters

$position
The layout cell position.

Returns

Charcoal\Ui\Layout\LayoutInterface
Chainable

Throws

InvalidArgumentException
If the position argument is not a number.
public integer
# position( )

Returns

integer
public array
# setStructure( array $layouts )

Prepare the layouts configuration in a simpler, ready, data structure.

Prepare the layouts configuration in a simpler, ready, data structure.

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

Parameters

$layouts
The original layout data, typically from configuration.

Returns

array
Computed layouts, ready for looping
public array
# structure( )

Returns

array
public integer
# numRows( )

Get the total number of rows

Get the total number of rows

Returns

integer
public integer|null
# rowIndex( integer $position = null )

Get the row index at a certain position

Get the row index at a certain position

Parameters

$position
Optional. Forced position.

Returns

integer|null
public array|null
# rowData( integer $position = null )

Get the row information

Get the row information

If no $position is specified, then the current position will be used.

Parameters

$position
Optional. Forced position.

Returns

array|null
public integer|null
# rowNumColumns( integer $position = null )

Get the number of columns (the colspan) of the row at a certain position

Get the number of columns (the colspan) of the row at a certain position

Parameters

$position
Optional. Forced position.

Returns

integer|null
public integer
# rowNumCells( integer $position = null )

Get the number of cells at current position

Get the number of cells at current position

This can be different than the number of columns, in case

Parameters

$position
Optional. Forced position.

Returns

integer
public integer
# rowFirstCellIndex( integer $position = null )

Get the cell index (position) of the first cell of current row

Get the cell index (position) of the first cell of current row

Parameters

$position
Optional. Forced position.

Returns

integer
public integer
# cellRowIndex( integer $position = null )

Get the cell index in the current row

Get the cell index in the current row

Parameters

$position
Optional. Forced position.

Returns

integer
public integer
# numCellsTotal( )

Get the total number of cells, in all rows

Get the total number of cells, in all rows

Returns

integer
public integer|null
# cellSpan( integer $position = null )

Get the span number (in # of columns) of the current cell

Get the span number (in # of columns) of the current cell

Parameters

$position
Optional. Forced position.

Returns

integer|null
public integer
# cellSpanBy12( integer $position = null )

Get the span number as a part of 12 (for bootrap-style grids)

Get the span number as a part of 12 (for bootrap-style grids)

Parameters

$position
Optional. Forced position.

Returns

integer
public boolean
# cellStartsRow( integer $position = null )

Get wether or not the current cell starts a row (is the first one on the row)

Get wether or not the current cell starts a row (is the first one on the row)

Parameters

$position
Optional. Forced position.

Returns

boolean
public boolean
# cellEndsRow( integer $position = null )

Get wether or not the current cell ends a row (is the last one on the row)

Get wether or not the current cell ends a row (is the last one on the row)

Parameters

$position
Optional. Forced position.

Returns

boolean
public string
# start( )

Returns

string
public string
# end( )

Returns

string
API documentation generated by ApiGen