-
Notifications
You must be signed in to change notification settings - Fork 554
/
Checkbox.php
46 lines (42 loc) · 1.23 KB
/
Checkbox.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
<?php
namespace A17\Twill\View\Components\Fields;
use Illuminate\Contracts\View\View;
class Checkbox extends TwillFormComponent
{
public function __construct(
string $name,
string $label,
bool $renderForBlocks = false,
bool $renderForModal = false,
bool $translated = false,
bool $required = false,
?string $note = '',
mixed $default = null,
bool $disabled = false,
bool $readOnly = false,
bool $inModal = false,
// Component specific
public bool $border = false,
public ?string $confirmMessageText = null,
public ?string $confirmTitleText = null,
public bool $requireConfirmation = false
) {
parent::__construct(
name: $name,
label: $label,
note: $note,
inModal: $inModal,
readOnly: $readOnly,
renderForBlocks: $renderForBlocks,
renderForModal: $renderForModal,
disabled: $disabled,
required: $required,
translated: $translated,
default: $default
);
}
public function render(): View
{
return view('twill::partials.form._checkbox', $this->data());
}
}