Generate file attachment transactions for explicit Remarkup attachments on common...
[phabricator.git] / src / view / form / control / AphrontFormTextControl.php
blobf7fd117cfd404e0ffce98258e2e6c349631c04dd
1 <?php
3 final class AphrontFormTextControl extends AphrontFormControl {
5 private $disableAutocomplete;
6 private $sigil;
7 private $placeholder;
8 private $autofocus;
10 public function setDisableAutocomplete($disable) {
11 $this->disableAutocomplete = $disable;
12 return $this;
15 private function getDisableAutocomplete() {
16 return $this->disableAutocomplete;
19 public function getPlaceholder() {
20 return $this->placeholder;
23 public function setPlaceholder($placeholder) {
24 $this->placeholder = $placeholder;
25 return $this;
28 public function setAutofocus($autofocus) {
29 $this->autofocus = $autofocus;
30 return $this;
33 public function getAutofocus() {
34 return $this->autofocus;
37 public function getSigil() {
38 return $this->sigil;
41 public function setSigil($sigil) {
42 $this->sigil = $sigil;
43 return $this;
46 protected function getCustomControlClass() {
47 return 'aphront-form-control-text';
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 ));