-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathInputElement.php
More file actions
50 lines (41 loc) · 899 Bytes
/
InputElement.php
File metadata and controls
50 lines (41 loc) · 899 Bytes
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
<?php
namespace ipl\Html\FormElement;
use ipl\Html\Attributes;
use ipl\Stdlib\Option;
class InputElement extends BaseFormElement
{
/** @var string Type of the input */
protected $type;
protected $tag = 'input';
/**
* Get the type of the input
*
* @return string
*/
public function getType()
{
return $this->type;
}
/**
* Set the type of the input
*
* @param string $type
*
* @return $this
*/
#[Option]
public function setType($type)
{
$this->type = (string) $type;
return $this;
}
protected function registerAttributeCallbacks(Attributes $attributes)
{
parent::registerAttributeCallbacks($attributes);
$attributes->registerAttributeCallback(
'type',
[$this, 'getType'],
[$this, 'setType']
);
}
}