[ 'type' => 'email', 'label' => 'Your Email', 'required' => true, ], 'password' => [ 'type' => 'text', 'subtype' => 'password', 'label' => 'Your Password', ], 'password_check' => [ 'type' => 'text', 'subtype' => 'password', 'label' => 'Verify Password', ], ]; public function __construct() { } public function setTitle(string $title): self { $this->title = $title; return $this; } public function getTitle():string { return $this->title; } public function setDescription(string|array $desc):self { if (is_array($desc)) { $desc = implode('', array_map(function ($p) { return '
'.$p.'
';}, $desc)); } else if (!str_contains('', $desc)) { $desc = '
'.$desc.'
'; } $this->description = $desc; return $this; } public function getDescription():string|array { return $this->description; } public function setFields(array $fields):self { $this->fields = array_merge($this->fields, $fields); return $this; } public function getFields():array { return $this->fields; } function getConfig(): array { return [ 'title' => $this->title ?? false, 'description' => $this->description??false, 'fields' => $this->fields ]; } }