34 lines
737 B
PHP
34 lines
737 B
PHP
|
|
<?php
|
||
|
|
|
||
|
|
namespace Lucent\Schema\BlockUi;
|
||
|
|
|
||
|
|
use Lucent\Schema\FieldInfo;
|
||
|
|
use Lucent\Schema\FieldInterface;
|
||
|
|
use Lucent\Schema\FieldType;
|
||
|
|
use Lucent\Schema\Nullable;
|
||
|
|
use Lucent\Schema\Validator\RequiredInterface;
|
||
|
|
|
||
|
|
class Heading implements FieldInterface
|
||
|
|
{
|
||
|
|
public FieldInfo $info;
|
||
|
|
|
||
|
|
public function __construct(
|
||
|
|
public string $name,
|
||
|
|
public string $label,
|
||
|
|
public ?int $min = null,
|
||
|
|
public ?int $max = null,
|
||
|
|
public string $default = "",
|
||
|
|
)
|
||
|
|
{
|
||
|
|
$this->info = new FieldInfo("heading", "Heading", FieldType::STRING);
|
||
|
|
}
|
||
|
|
|
||
|
|
public function format(array $input, array $output): array
|
||
|
|
{
|
||
|
|
$output[$this->name] = $input[$this->name] ?? "";
|
||
|
|
return $output;
|
||
|
|
}
|
||
|
|
|
||
|
|
}
|
||
|
|
|