a-blog cms PHP API Reference

FunctionTag
in package

FinalYes

ブロックエディターの機能タグ(`<acms-block-editor-function-tag>`)の保存形式を扱う。

フロントエンドの @ablogcms/block-editor/function-tag(utils/functionTag.ts)と対になり、 props は UTF-8 JSON を Base64 化して data-block-props 属性に格納する。

Table of Contents

Constants

NAME  = 'acms-block-editor-function-tag'
機能タグを示すカスタム要素名(フロントエンド utils/functionTag.ts の FUNCTION_TAG_NAME と対)

Methods

decodeProps()  : array<string|int, mixed>
data-block-props の値をデコードする
encodeProps()  : string
props を data-block-props の値へエンコードする
render()  : string
機能タグの HTML を組み立てる
escape()  : string

Constants

NAME

機能タグを示すカスタム要素名(フロントエンド utils/functionTag.ts の FUNCTION_TAG_NAME と対)

public mixed NAME = 'acms-block-editor-function-tag'

Methods

decodeProps()

data-block-props の値をデコードする

public static decodeProps(string $encoded) : array<string|int, mixed>
Parameters
$encoded : string
Return values
array<string|int, mixed>

encodeProps()

props を data-block-props の値へエンコードする

public static encodeProps(array<string|int, mixed> $props) : string
Parameters
$props : array<string|int, mixed>
Return values
string

render()

機能タグの HTML を組み立てる

public static render(string $blockType, array<string|int, mixed> $props[, array{id?: string, class?: string} $attributes = [] ]) : string
Parameters
$blockType : string

data-block-type の値

$props : array<string|int, mixed>
$attributes : array{id?: string, class?: string} = []

機能タグ要素に付ける属性

Return values
string

escape()

private static escape(string $value) : string
Parameters
$value : string
Return values
string

        
On this page

Search results