a-blog cms PHP API Reference

FunctionTagRegistry
in package

機能タグの展開ハンドラを data-block-type ごとに保持する。

コアは 'embed'(埋め込みブロック)と 'html'(HTML ブロック)を登録する。拡張アプリは ServiceProvider::init() などで Application::make('block-editor.function-tags') を 取得し、独自のハンドラを追加できる。

Table of Contents

Properties

$handlers  : array<string, FunctionTagHandler>

Methods

blockTypes()  : array<string|int, string>
登録済みの data-block-type 一覧
find()  : FunctionTagHandler|null
data-block-type に対応するハンドラを返す。未登録なら null
register()  : void
ハンドラを登録する

Properties

Methods

blockTypes()

登録済みの data-block-type 一覧

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

register()

ハンドラを登録する

public register(FunctionTagHandler $handler) : void

同じ data-block-type が既にある場合は後から登録したもので置き換える。 拡張アプリがコアの挙動を差し替えられるようにするため、衝突をエラーにしない。

Parameters
$handler : FunctionTagHandler

        
On this page

Search results