Layout
in package
implements
JsonSerializable
FinalYes
Defines the column system and base grid for an article.
Every Apple News article requires a layout object to determine how components are positioned relative to the grid columns.
Tags
Table of Contents
Interfaces
- JsonSerializable
Properties
Methods
- __construct() : mixed
- jsonSerialize() : array<string, mixed>
- setGutter() : self
- Set the space (gutter) between columns.
- setMargin() : self
- Set the horizontal margin for the article content.
Properties
$columns read-only
private
int
$columns
$gutter
private
int|null
$gutter
= null
Space between columns.
$margin
private
int|null
$margin
= null
Space outside the content area.
$width read-only
private
int
$width
Methods
__construct()
public
__construct(int $columns, int $width) : mixed
Parameters
- $columns : int
-
Total number of columns in the grid.
- $width : int
-
Total width of the article in points.
jsonSerialize()
public
jsonSerialize() : array<string, mixed>
Return values
array<string, mixed>setGutter()
Set the space (gutter) between columns.
public
setGutter(int $gutter) : self
Parameters
- $gutter : int
Return values
selfsetMargin()
Set the horizontal margin for the article content.
public
setMargin(int $margin) : self
Parameters
- $margin : int