/**
* @inheritDoc
*/
public function render($content = null)
{
if ($content === null) {
if (!isset($this->parts['{beginWrapper'])) {
$options = $this->wrapperOptions;
$tag = ArrayHelper::remove($options, 'tag', 'div');
$this->parts['{beginWrapper}'] = Html::beginTag($tag, $options);
$this->parts['{endWrapper}'] = Html::endTag($tag);
}
if ($this->label === false) {
$this->parts['{label}'] = '';
$this->parts['{beginLabel}'] = '';
$this->parts['{labelTitle}'] = '';
$this->parts['{endLabel}'] = '';
} elseif (!isset($this->parts['{beginLabel'])) {
$this->parts['{beginLabel}'] = Html::beginTag('label', $this->labelOptions);
$this->parts['{endLabel}'] = Html::endTag('label');
$attribute = Html::getAttributeName($this->attribute);
$this->parts['{labelTitle}'] = Html::encode($this->label ? $this->label : $this->model->getAttributeLabel($attribute));
}
if ($this->inputTemplate) {
$input = isset($this->parts['{input}']) ? $this->parts['{input}'] : Html::activeTextInput($this->model, $this->attribute, $this->inputOptions);
$this->parts['{input}'] = strtr($this->inputTemplate, ['{input}' => $input]);
}
}
return parent::render($content);
}