-
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathTextArea.php
More file actions
79 lines (73 loc) · 2.05 KB
/
TextArea.php
File metadata and controls
79 lines (73 loc) · 2.05 KB
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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
<?php
declare(strict_types=1);
namespace PHPForge\Html\FormControl;
use PHPForge\Html\{
Attribute\CanBeAutofocus,
Attribute\Custom\HasContent,
Attribute\Field\HasGenerateField,
Attribute\HasTabindex,
Attribute\Input\CanBeDisabled,
Attribute\Input\CanBeReadonly,
Attribute\Input\CanBeRequired,
Attribute\Input\HasAutocomplete,
Attribute\Input\HasDirname,
Attribute\Input\HasForm,
Attribute\Input\HasMaxLength,
Attribute\Input\HasMinLength,
Attribute\Input\HasPlaceholder,
Attribute\Tag\HasCols,
Attribute\Tag\HasRows,
Attribute\Tag\HasWrap,
Base\AbstractElement,
Interop\ContentInterface,
Interop\InputInterface,
Interop\LengthInterface,
Interop\PlaceholderInterface,
Interop\RenderInterface,
Interop\RequiredInterface
};
/**
* The `<textarea>` HTML element represents a multi-line plain-text editing control, useful when you want to allow users
* to enter a sizable amount of free-form text, for example, a comment on a review or feedback form.
*
* @link https://html.spec.whatwg.org/multipage/form-elements.html#the-textarea-element
*/
final class TextArea extends AbstractElement implements
ContentInterface,
InputInterface,
LengthInterface,
PlaceholderInterface,
RenderInterface,
RequiredInterface
{
use CanBeAutofocus;
use CanBeDisabled;
use CanBeReadonly;
use CanBeRequired;
use HasAutocomplete;
use HasCols;
use HasContent;
use HasDirname;
use HasForm;
use HasGenerateField;
use HasMaxLength;
use HasMinLength;
use HasPlaceholder;
use HasRows;
use HasTabindex;
use HasWrap;
/**
* This method is used to configure the widget with the provided default definitions.
*/
protected function loadDefaultDefinitions(): array
{
return [
'id()' => [$this->generateId('textarea-')],
'template()' => ['{prefix}\n{tag}\n{suffix}'],
];
}
protected function run(): string
{
return $this->buildElement('textarea', $this->content);
}
}