Apple News API PHP Client

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
see
https://developer.apple.com/documentation/applenewsformat/layout

Table of Contents

Interfaces

JsonSerializable

Properties

$columns  : int
$gutter  : int|null
$margin  : int|null
$width  : int

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
self

setMargin()

Set the horizontal margin for the article content.

public setMargin(int $margin) : self
Parameters
$margin : int
Return values
self

        
On this page

Search results