BlockEditor
class BlockEditor extends BaseFormField (View source)
Traits
Properties
bool | $renderForBlocks | from RenderForBlocks | |
protected array | $blocks | ||
protected array | $excludeBlocks | ||
protected bool | $isSettings | ||
protected bool | $withoutSeparator |
Methods
No description
No description
Set the name of the field, if no label is set yet, this method will also update that.
Set the label of the field, you can use twillTrans('') Laravel translatable strings here.
Marks the field as mandatory, however you still need to add validation rules.
No description
In render we dynamically build the constructor arguments.
No description
No description
Default is all, but using this method you can limit the block types the field can use.
Use this method if you want to exclude any block types
Details
RenderForBlocks
renderForBlocks(bool $renderForBlocks = true)
No description
bool
forBlocks()
No description
protected
__construct(string $component, string|null $name = null, string|null $label = null, string|null $note = null, bool|null $required = false, bool|null $disabled = false, mixed $default = null, mixed $connectedTo = null, array $mandatoryProperties = [])
No description
static BaseFormField
make()
No description
BaseFormField
name(string $name)
Set the name of the field, if no label is set yet, this method will also update that.
BaseFormField
default(mixed $default)
No description
BaseFormField
label(string $label)
Set the label of the field, you can use twillTrans('') Laravel translatable strings here.
BaseFormField
note(string $note)
Add a note to the field to display on the form.
BaseFormField
required(bool $required = true)
Marks the field as mandatory, however you still need to add validation rules.
BaseFormField
disabled(bool $disabled = true)
Marks the field as disabled.
There might be some fields not supporting this.
connectedTo(string $fieldName, mixed $fieldValues, array $options = [])
No description
View
render()
No description
protected array
getAdditionalConstructorArguments()
In render we dynamically build the constructor arguments.
In exceptional cases such as browser we have more conditionals and we can use this method to set those.
BlockEditor
withoutSeparator(bool $withoutSeparator = true)
No description
BlockEditor
isSettings(bool $isSettings = true)
No description
BlockEditor
blocks(array $blocks)
Default is all, but using this method you can limit the block types the field can use.
BlockEditor
excludeBlocks(array $blocks)
Use this method if you want to exclude any block types