Skip to content

Instantly share code, notes, and snippets.

@tobimori
Created April 21, 2024 16:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tobimori/9d27c7c61bf33536189ca4e6e6b4b9b2 to your computer and use it in GitHub Desktop.
Save tobimori/9d27c7c61bf33536189ca4e6e6b4b9b2 to your computer and use it in GitHub Desktop.
<?php
use tobimori\DreamForm\Fields\Field;
class HeadingField extends Field
{
public static function blueprint(): array
{
return [
'label' => 'Überschrift',
'preview' => 'heading',
'wysiwg' => true,
'fields' => [
'text' => [
'label' => t('field.blocks.heading.text'),
'type' => 'writer',
'inline' => true,
'placeholder' => t('field.blocks.heading.placeholder'),
],
'level' => [
'type' => 'hidden',
'default' => 'h2'
]
]
];
}
public static function hasValue(): bool
{
return false;
}
public static function group(): string
{
return 'cosmetic';
}
public static function type(): string
{
return 'heading';
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment