renderLabel() публичный Метод

Renders 'label' part of visual row of controls.
public renderLabel ( Nette\Forms\IControl $control ) : string
$control Nette\Forms\IControl
Результат string
Пример #1
0
 public function renderLabel(Nette\Forms\IControl $control)
 {
     $this->controlsInit();
     return parent::renderLabel($control);
 }
Пример #2
0
 /**
  * Renders 'label' part of visual row of controls.
  * @param \Nette\Forms\IControl $control
  * @return string
  */
 public function renderLabel(\Nette\Forms\IControl $control)
 {
     if (!$control instanceof \Nette\Forms\Controls\Checkbox && !$control instanceof \Nette\Forms\Controls\Button) {
         if ($control->isRequired()) {
             $label = $control->getLabel();
             $caption = $label->getText();
             $required = \Nette\Utils\Html::el('small');
             $required->setText($this->requiredLabel);
             $label->setHtml($caption . " " . (string) $required);
             return $label;
         }
     }
     return parent::renderLabel($control);
 }