LINE Messaging API SDK for PHP

ButtonComponentBuilder implements ComponentBuilder

A builder class for button component.

Interfaces, Classes and Traits

ComponentBuilder
The interface that has a responsibility to build component.

Table of Contents

$actionBuilder  : TemplateActionBuilder
$adjustMode  : ComponentAdjustMode
$color  : string
$component  : array<string|int, mixed>|null
$flex  : int
$gravity  : ComponentGravity
$height  : ComponentButtonHeight
$margin  : ComponentMargin
$offsetBottom  : string
$offsetEnd  : string
$offsetStart  : string
$offsetTop  : string
$position  : string
$style  : ComponentButtonStyle
__construct()  : mixed
ButtonComponentBuilder constructor.
build()  : array<string|int, mixed>
Builds button component structure.
builder()  : ButtonComponentBuilder
Create empty ButtonComponentBuilder.
setAction()  : ButtonComponentBuilder
Set action.
setAdjustMode()  : $this
Set adjustMode
setColor()  : ButtonComponentBuilder
Set color.
setFlex()  : ButtonComponentBuilder
Set flex.
setGravity()  : ButtonComponentBuilder
Set gravity.
setHeight()  : ButtonComponentBuilder
Set height.
setMargin()  : ButtonComponentBuilder
Set margin.
setOffsetBottom()  : $this
Set offsetBottom.
setOffsetEnd()  : $this
Set offsetEnd.
setOffsetStart()  : $this
Set offsetStart.
setOffsetTop()  : $this
Set offsetTop.
setPosition()  : $this
Set position.
setStyle()  : ButtonComponentBuilder
Set style.

Properties

Methods

__construct()

ButtonComponentBuilder constructor.

public __construct(TemplateActionBuilder|null $actionBuilder[, int|null $flex = null ][, ComponentMargin|null $margin = null ][, ComponentButtonHeight|null $height = null ][, ComponentButtonStyle|null $style = null ][, string|null $color = null ][, ComponentGravity|null $gravity = null ]) : mixed
Parameters
$actionBuilder : TemplateActionBuilder|null
$flex : int|null = null
$margin : ComponentMargin|null = null
$height : ComponentButtonHeight|null = null
$style : ComponentButtonStyle|null = null
$color : string|null = null
$gravity : ComponentGravity|null = null
Return values
mixed

build()

Builds button component structure.

public build() : array<string|int, mixed>
Return values
array<string|int, mixed>

setOffsetBottom()

Set offsetBottom.

public setOffsetBottom(string|ComponentSpacing|null $offsetBottom) : $this

specifiable percentage, pixel and keyword. (e.g. percentage: 5% pixel: 5px keyword: none (defined in ComponentSpacing)

Parameters
$offsetBottom : string|ComponentSpacing|null
Return values
$this

setOffsetEnd()

Set offsetEnd.

public setOffsetEnd(string|ComponentSpacing|null $offsetEnd) : $this

specifiable percentage, pixel and keyword. (e.g. percentage: 5% pixel: 5px keyword: none (defined in ComponentSpacing)

Parameters
$offsetEnd : string|ComponentSpacing|null
Return values
$this

setOffsetStart()

Set offsetStart.

public setOffsetStart(string|ComponentSpacing|null $offsetStart) : $this

specifiable percentage, pixel and keyword. (e.g. percentage: 5% pixel: 5px keyword: none (defined in ComponentSpacing)

Parameters
$offsetStart : string|ComponentSpacing|null
Return values
$this

setOffsetTop()

Set offsetTop.

public setOffsetTop(string|ComponentSpacing|null $offsetTop) : $this

specifiable percentage, pixel and keyword. (e.g. percentage: 5% pixel: 5px keyword: none (defined in ComponentSpacing)

Parameters
$offsetTop : string|ComponentSpacing|null
Return values
$this

Search results