Created
April 21, 2024 16:29
-
-
Save tobimori/9d27c7c61bf33536189ca4e6e6b4b9b2 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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