abstract class TwillBlockComponent extends Component (View source)

Properties

Block|null $block
RenderData|null $renderData
bool $inEditor

Methods

__construct()

No description

forRendering(Block $block, RenderData $renderData, bool $inEditor)

No description

string|null
image(string $role, string $crop = 'default', array $params = [])

No description

mixed
input(string $fieldName)

No description

mixed
translatedInput(string $fieldName)

No description

static array
getCrops()

No description

static string
getBlockIdentifier()

This string should contain no special characters or spaces.

Collection
repeater(string $repeaterName)

No description

static string|null
getBlockTitleField()

You can use this method to use a form field to get the title of the block in the used blocks list.

static bool
shouldHidePrefix()

If the prefix should be hidden when using getBlockTitleField.

static string
getBlockTitle()

No description

static string
getBlockGroup()

No description

static string
getBlockIcon()

No description

array
getValidationRules()

No description

array
getForm()

No description

View
renderForm()

No description

Details

final __construct()

No description

static TwillBlockComponent forRendering(Block $block, RenderData $renderData, bool $inEditor)

No description

Parameters

Block $block
RenderData $renderData
bool $inEditor

Return Value

TwillBlockComponent

string|null image(string $role, string $crop = 'default', array $params = [])

No description

Parameters

string $role
string $crop
array $params

Return Value

string|null

mixed input(string $fieldName)

No description

Parameters

string $fieldName

Return Value

mixed

mixed translatedInput(string $fieldName)

No description

Parameters

string $fieldName

Return Value

mixed

static array getCrops()

No description

Return Value

array

static string getBlockIdentifier()

This string should contain no special characters or spaces.

It will be used as the database identifier for the block, it should not change dynamically nor should it overlap with an existing block.

Return Value

string

Collection repeater(string $repeaterName)

No description

Parameters

string $repeaterName

Return Value

Collection

static string|null getBlockTitleField()

You can use this method to use a form field to get the title of the block in the used blocks list.

By default this will be prefixed with getBlockTitle, you can disable that by returning true in shouldHidePrefix.

Return Value

string|null

static bool shouldHidePrefix()

If the prefix should be hidden when using getBlockTitleField.

Return Value

bool

static string getBlockTitle()

No description

Return Value

string

static string getBlockGroup()

No description

Return Value

string

static string getBlockIcon()

No description

Return Value

string

array getValidationRules()

No description

Return Value

array

array getTranslatableValidationRules()

No description

Return Value

array

abstract Form getForm()

No description

Return Value

Form

final View renderForm()

No description

Return Value

View