blob: 6aa1456130022edf2d164fdd335a425a6d12afa0 (
plain)
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
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
|
<?php
namespace ipl\Html\Contract;
use ipl\Html\Attributes;
use ipl\Html\Form;
/**
* Representation of form elements
*/
interface FormElement extends Wrappable
{
/**
* Get the attributes or options of the element
*
* @return Attributes
*/
public function getAttributes();
/**
* Add attributes or options to the form element
*
* @param iterable $attributes
*
* @return $this
*/
public function addAttributes($attributes);
/**
* Get the description for the element, if any
*
* @return string|null
*/
public function getDescription();
/**
* Get the label for the element, if any
*
* @return string|null
*/
public function getLabel();
/**
* Get the validation error messages
*
* @return array
*/
public function getMessages();
/**
* Add a validation error message
*
* @param string $message
*
* @return $this
*/
public function addMessage($message);
/**
* Get the name of the element
*
* @return string
*/
public function getName();
/**
* Get whether the element has a value
*
* @return bool False if the element's value is null, the empty string or the empty array; true otherwise
*/
public function hasValue();
/**
* Get the value of the element
*
* @return mixed
*/
public function getValue();
/**
* Set the value of the element
*
* @param mixed $value
*
* @return $this
*/
public function setValue($value);
/**
* Get whether the element has been validated
*
* @return bool
*/
public function hasBeenValidated();
/**
* Get whether the element is ignored
*
* @return bool
*/
public function isIgnored();
/**
* Get whether the element is required
*
* @return bool
*/
public function isRequired();
/**
* Get whether the element is valid
*
* @return bool
*/
public function isValid();
/**
* Handler which is called after this element has been registered
*
* @param Form $form
*
* @return void
*/
public function onRegistered(Form $form);
}
|