ConditionalComponentLayout
in package
implements
ConditionalInterface
Conditional properties for component layouts.
Allows layout properties like margin, padding, and column span to change based on conditions.
Tags
Table of Contents
Interfaces
- ConditionalInterface
- Interface for all conditional objects.
Properties
- $columnSpan : int|null
- The column span.
- $columnStart : int|null
- The column start position.
- $conditions : array<int, Condition>
- The conditions that must be met.
- $contentInset : int|array<string, mixed>|null
- The content inset.
- $horizontalContentAlignment : string|null
- The horizontal content alignment.
- $ignoreDocumentGutter : bool|null
- Whether to ignore document gutter.
- $ignoreDocumentMargin : bool|null
- Whether to ignore document margin.
- $margin : int|array<string, mixed>|null
- The margin configuration.
- $maximumWidth : int|string|null
- The maximum width.
- $minimumHeight : int|string|null
- The minimum height.
- $minimumWidth : int|string|null
- The minimum width.
- $padding : int|array<string, mixed>|null
- The padding.
Methods
- addCondition() : $this
- Add a condition.
- fullWidthOnCompact() : self
- Create a full-width layout for compact devices.
- hasConditions() : bool
- Check if any conditions have been set.
- jsonSerialize() : array<string, mixed>
- {@inheritdoc}
- setColumnSpan() : $this
- Set the column span.
- setColumnStart() : $this
- Set the column start.
- setContentInset() : $this
- Set the content inset.
- setHorizontalContentAlignment() : $this
- Set the horizontal content alignment.
- setIgnoreDocumentGutter() : $this
- Set whether to ignore document gutter.
- setIgnoreDocumentMargin() : $this
- Set whether to ignore document margin.
- setMargin() : $this
- Set the margin.
- setMaximumWidth() : $this
- Set the maximum width.
- setMinimumHeight() : $this
- Set the minimum height.
- setMinimumWidth() : $this
- Set the minimum width.
- setPadding() : $this
- Set the padding.
Properties
$columnSpan
The column span.
private
int|null
$columnSpan
= null
$columnStart
The column start position.
private
int|null
$columnStart
= null
$conditions
The conditions that must be met.
private
array<int, Condition>
$conditions
= []
$contentInset
The content inset.
private
int|array<string, mixed>|null
$contentInset
= null
$horizontalContentAlignment
The horizontal content alignment.
private
string|null
$horizontalContentAlignment
= null
$ignoreDocumentGutter
Whether to ignore document gutter.
private
bool|null
$ignoreDocumentGutter
= null
$ignoreDocumentMargin
Whether to ignore document margin.
private
bool|null
$ignoreDocumentMargin
= null
$margin
The margin configuration.
private
int|array<string, mixed>|null
$margin
= null
$maximumWidth
The maximum width.
private
int|string|null
$maximumWidth
= null
$minimumHeight
The minimum height.
private
int|string|null
$minimumHeight
= null
$minimumWidth
The minimum width.
private
int|string|null
$minimumWidth
= null
$padding
The padding.
private
int|array<string, mixed>|null
$padding
= null
Methods
addCondition()
Add a condition.
public
addCondition(Condition $condition) : $this
Parameters
- $condition : Condition
-
The condition to add.
Return values
$thisfullWidthOnCompact()
Create a full-width layout for compact devices.
public
static fullWidthOnCompact() : self
Return values
self —A new instance.
hasConditions()
Check if any conditions have been set.
public
hasConditions() : bool
Return values
bool —True if conditions exist.
jsonSerialize()
{@inheritdoc}
public
jsonSerialize() : array<string, mixed>
Return values
array<string, mixed>setColumnSpan()
Set the column span.
public
setColumnSpan(int $columnSpan) : $this
Parameters
- $columnSpan : int
-
Number of columns to span.
Return values
$thissetColumnStart()
Set the column start.
public
setColumnStart(int $columnStart) : $this
Parameters
- $columnStart : int
-
The starting column.
Return values
$thissetContentInset()
Set the content inset.
public
setContentInset(int|array<string, mixed> $inset) : $this
Parameters
- $inset : int|array<string, mixed>
-
The inset value or configuration.
Return values
$thissetHorizontalContentAlignment()
Set the horizontal content alignment.
public
setHorizontalContentAlignment(string $alignment) : $this
Parameters
- $alignment : string
-
One of 'left', 'center', 'right'.
Return values
$thissetIgnoreDocumentGutter()
Set whether to ignore document gutter.
public
setIgnoreDocumentGutter(bool $ignore) : $this
Parameters
- $ignore : bool
-
Whether to ignore.
Return values
$thissetIgnoreDocumentMargin()
Set whether to ignore document margin.
public
setIgnoreDocumentMargin(bool $ignore) : $this
Parameters
- $ignore : bool
-
Whether to ignore.
Return values
$thissetMargin()
Set the margin.
public
setMargin(int|array<string, mixed> $margin) : $this
Parameters
- $margin : int|array<string, mixed>
-
The margin value or configuration.
Return values
$thissetMaximumWidth()
Set the maximum width.
public
setMaximumWidth(int|string $width) : $this
Parameters
- $width : int|string
-
The maximum width.
Return values
$thissetMinimumHeight()
Set the minimum height.
public
setMinimumHeight(int|string $height) : $this
Parameters
- $height : int|string
-
The minimum height.
Return values
$thissetMinimumWidth()
Set the minimum width.
public
setMinimumWidth(int|string $width) : $this
Parameters
- $width : int|string
-
The minimum width.
Return values
$thissetPadding()
Set the padding.
public
setPadding(int|array<string, mixed> $padding) : $this
Parameters
- $padding : int|array<string, mixed>
-
The padding value or configuration.