a-blog cms PHP API Reference

AuthoringTagRegistry
in package

入稿用タグの変換ハンドラを要素名ごとに保持する。

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

Table of Contents

Constants

TAG_NAME_PATTERN  = '/\A[a-z][a-z0-9]*(?:-[a-z0-9]+)+\z/'
Why not 任意の文字列を許す: 要素名は走査用の正規表現に埋め込むため、カスタム要素名の形に限る

Properties

$handlers  : array<string, AuthoringTagHandler>

Methods

find()  : AuthoringTagHandler|null
要素名に対応するハンドラを返す。未登録なら null
register()  : void
ハンドラを登録する
tagNames()  : array<int, string>
登録済みの要素名一覧

Constants

TAG_NAME_PATTERN

Why not 任意の文字列を許す: 要素名は走査用の正規表現に埋め込むため、カスタム要素名の形に限る

private mixed TAG_NAME_PATTERN = '/\A[a-z][a-z0-9]*(?:-[a-z0-9]+)+\z/'

Properties

Methods

register()

ハンドラを登録する

public register(AuthoringTagHandler $handler) : void

同じ要素名が既にある場合は後から登録したもので置き換える(拡張アプリがコアの挙動を差し替えられるように)。

Parameters
$handler : AuthoringTagHandler
Tags
throws
InvalidArgumentException

要素名がカスタム要素名の形でない場合

tagNames()

登録済みの要素名一覧

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

        
On this page

Search results