field = $field; } public function setPlaceholder(string $placeholder): self { $this->placeholder = $placeholder; return $this; } public function setWidth(int $width): self { $this->width = $width; return $this; } public function setAdaptiveWidth(int $adaptive_width): self { $this->adaptive_width = $adaptive_width; return $this; } public function getView(): CTextBox { $view = (new CTextBox($this->field->getName(), $this->field->getValue(), false, $this->field->getMaxLength())) ->setEnabled(!$this->isDisabled()) ->setAriaRequired($this->isRequired()); if ($this->placeholder !== '') { $view->setAttribute('placeholder', $this->placeholder); } if ($this->adaptive_width !== null) { $view->setAdaptiveWidth($this->adaptive_width); } else { $view->setWidth($this->width); } return $view; } }