NaifyView\Runtime\RuntimeContext クラス

RuntimeContext — generated runtime ABI の Runtime Context

compiled template class から呼ばれる runtime surface。 compiler が生成する PHP と対になるため、変更時は generated code との互換を意識する。

使用例

// generated PHP class から呼ばれる runtime ABI。
// compiler が吐いたコードと対になるため、公開 API として直接使わない。

プロパティ

名前型説明
private $scope array
private $state array
private $slotOverrides array

メソッド

メソッド説明
public __construct(array $scope, array $state, array $slotOverrides = '...'): void インスタンスを初期化する
public scope(): array `scope()` を実行する
public export(): array `export()` を実行する
public state(): array `state()` を実行する
public exportScopeState(): array `exportScopeState()` を実行する
public getStateValue(string $name): mixed `getStateValue()` の値を返す
public getStateArrayValue(string $name): array `getStateArrayValue()` の値を返す
public slotOverrides(): array `slotOverrides()` を実行する
public withScope(array $scope): RuntimeContext `withScope()` を実行する
public withState(array $state): RuntimeContext `withState()` を実行する
public withStateValue(string $name, mixed $value): RuntimeContext `withStateValue()` を実行する
public withStateValues(array $values): RuntimeContext `withStateValues()` を実行する
public withSlotOverrides(array $slotOverrides): RuntimeContext `withSlotOverrides()` を実行する
public withoutSlotOverrides(): RuntimeContext `withoutSlotOverrides()` を実行する
public deriveWithoutSlotOverrides(?array $scope, ?array $state): RuntimeContext `deriveWithoutSlotOverrides()` を実行する
public derive(?array $scope, ?array $state, ?array $slotOverrides): RuntimeContext `derive()` を実行する
public deriveWithStateValue(?array $scope, ?array $state, ?array $slotOverrides, string $name, mixed $value): RuntimeContext `deriveWithStateValue()` を実行する
public withScopeValue(string $name, mixed $value): RuntimeContext `withScopeValue()` を実行する
public withScopeValues(array $values): RuntimeContext `withScopeValues()` を実行する
public hasSlotOverride(string $name): bool `hasSlotOverride()` かを返す
public getSlotOverride(string $name): ?string `getSlotOverride()` の値を返す