Commits

Nikola Kovacs  committed aa812b4

Respect required=false label option.

Adding 'required'=>false to labelOptions for an input row will use CActiveForm::label instead of CActiveForm::labelEx,
so that the styling for required attributes can be disabled on individual attribute inputs.

  • Participants
  • Parent commits ef30996

Comments (0)

Files changed (1)

File widgets/input/TbInput.php

 	protected function getLabel()
 	{
 		if ($this->label !== false && !in_array($this->type, array('checkbox', 'radio')) && $this->hasModel())
-			return $this->form->labelEx($this->model, $this->attribute, $this->labelOptions);
+			if (isset($this->labelOptions['required']) && $this->labelOptions['required'] === false) {
+				return $this->form->label($this->model, $this->attribute, $this->labelOptions);
+			} else {
+				return $this->form->labelEx($this->model, $this->attribute, $this->labelOptions);
+			}
 		else if ($this->label !== null)
 			return $this->label;
 		else