InMultiplierTrait uses trait:short, trait:short
Table of Contents
Properties
- $multiplierItemId : string|int|null
- $multiplierRenderMethod : string|null
- $multiplierUniqueKey : string|null
- $renderingDefault : bool
- Guard against the `renderDefault()` and `render()` delegation loop.
- $renderParams : array<string, mixed>
- $renderStyle : string
Methods
- getMultiplierItemId() : string|int|null
- getMultiplierRenderMethod() : string|null
- Returns the render method of the multiplier.
- getMultiplierUniqueKey() : string|null
- Returns the unique key of the multiplier.
- getRenderParams() : array<string, mixed>
- getRenderStyle() : string
- isInMultiplier() : bool
- Returns whether the component is rendered inside a multiplier.
- loadState() : void
- setMultiplierContext() : void
- Sets the multiplier context; called automatically from `MultiControlMacros`.
- setRenderStyle() : void
- handleMultiplierSuccess() : void
- Handles a successful action in a multiplier (e.g. a form submit) and redraws the right snippet.
- renderDefault() : void
- Aliases `render()` when no other render method is specified.
- availableRenderStyles() : array<int, string>
- Returns styles derived from public `renderXxx()` methods, without `render()` and `renderDefault()`.
- availableRenderStylesHint() : string
- Returns the message suffix listing styles; empty when the component has none.
- firstRenderStyle() : string|null
- Returns the first available style, used as an example in the message.
Properties
$multiplierItemId
private
string|int|null
$multiplierItemId
= null
$multiplierRenderMethod
private
string|null
$multiplierRenderMethod
= null
$multiplierUniqueKey
private
string|null
$multiplierUniqueKey
= null
$renderingDefault
Guard against the `renderDefault()` and `render()` delegation loop.
private
bool
$renderingDefault
= false
$renderParams
private
array<string, mixed>
$renderParams
= []
$renderStyle
private
string
$renderStyle
= 'default'
Methods
getMultiplierItemId()
public
getMultiplierItemId() : string|int|null
Return values
string|int|nullgetMultiplierRenderMethod()
Returns the render method of the multiplier.
public
getMultiplierRenderMethod() : string|null
Return values
string|nullgetMultiplierUniqueKey()
Returns the unique key of the multiplier.
public
getMultiplierUniqueKey() : string|null
Return values
string|nullgetRenderParams()
public
getRenderParams() : array<string, mixed>
Return values
array<string, mixed>getRenderStyle()
public
getRenderStyle() : string
Return values
stringisInMultiplier()
Returns whether the component is rendered inside a multiplier.
public
isInMultiplier() : bool
Return values
boolloadState()
public
loadState(array<string, mixed> $params) : void
Parameters
- $params : array<string, mixed>
setMultiplierContext()
Sets the multiplier context; called automatically from `MultiControlMacros`.
public
setMultiplierContext(string $uniqueKey, string $renderMethod) : void
It is the only writer of the properties above; the component parameters are copies for templates.
Parameters
- $uniqueKey : string
- $renderMethod : string
setRenderStyle()
public
setRenderStyle(string $style[, array<string, mixed> $params = [] ]) : void
Parameters
- $style : string
- $params : array<string, mixed> = []
handleMultiplierSuccess()
Handles a successful action in a multiplier (e.g. a form submit) and redraws the right snippet.
protected
handleMultiplierSuccess() : void
renderDefault()
Aliases `render()` when no other render method is specified.
protected
renderDefault() : void
IMPORTANT: the guard prevents an endless loop. A component whose render() delegates
by MultiplierRenderStyleTrait::getRenderStyle() (default 'default') builds
the method name renderDefault and lands on this alias, which calls render() again.
Without the guard that exhausts memory and, in production mode, the page ends
half-rendered with no readable trace. The guard turns it into an exception that says
what to add to the template. Components with a real renderDefault() are unaffected.
availableRenderStyles()
Returns styles derived from public `renderXxx()` methods, without `render()` and `renderDefault()`.
private
availableRenderStyles() : array<int, string>
Return values
array<int, string>availableRenderStylesHint()
Returns the message suffix listing styles; empty when the component has none.
private
availableRenderStylesHint() : string
Return values
stringfirstRenderStyle()
Returns the first available style, used as an example in the message.
private
firstRenderStyle() : string|null