Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
freebsd
GitHub Repository: freebsd/phabricator
Path: blob/master/src/view/form/control/AphrontFormTextControl.php
12262 views
1
<?php
2
3
final class AphrontFormTextControl extends AphrontFormControl {
4
5
private $disableAutocomplete;
6
private $sigil;
7
private $placeholder;
8
private $autofocus;
9
10
public function setDisableAutocomplete($disable) {
11
$this->disableAutocomplete = $disable;
12
return $this;
13
}
14
15
private function getDisableAutocomplete() {
16
return $this->disableAutocomplete;
17
}
18
19
public function getPlaceholder() {
20
return $this->placeholder;
21
}
22
23
public function setPlaceholder($placeholder) {
24
$this->placeholder = $placeholder;
25
return $this;
26
}
27
28
public function setAutofocus($autofocus) {
29
$this->autofocus = $autofocus;
30
return $this;
31
}
32
33
public function getAutofocus() {
34
return $this->autofocus;
35
}
36
37
public function getSigil() {
38
return $this->sigil;
39
}
40
41
public function setSigil($sigil) {
42
$this->sigil = $sigil;
43
return $this;
44
}
45
46
protected function getCustomControlClass() {
47
return 'aphront-form-control-text';
48
}
49
50
protected function renderInput() {
51
return javelin_tag(
52
'input',
53
array(
54
'type' => 'text',
55
'name' => $this->getName(),
56
'value' => $this->getValue(),
57
'disabled' => $this->getDisabled() ? 'disabled' : null,
58
'autocomplete' => $this->getDisableAutocomplete() ? 'off' : null,
59
'id' => $this->getID(),
60
'sigil' => $this->getSigil(),
61
'placeholder' => $this->getPlaceholder(),
62
'autofocus' => ($this->getAutofocus() ? 'autofocus' : null),
63
));
64
}
65
66
}
67
68