Nette\Forms\Controls\BaseControl::getErrors PHP Метод

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

Returns errors corresponding to control.
public getErrors ( ) : array
Результат array
    public function getErrors()
    {
        return array_unique($this->errors);
    }

Usage Example

 /**
  * @internal
  * @param \Nette\Forms\Controls\BaseControl $control
  * @return \Nette\Utils\Html
  */
 public function getControlError(Controls\BaseControl $control)
 {
     if (!($errors = $control->getErrors()) || !$this->errorsAtInputs) {
         return Html::el();
     }
     $error = reset($errors);
     // If we have translator, translate!
     if (!$error instanceof Html && ($translator = $control->form->getTranslator())) {
         $error = $translator->translate($error);
         // wtf?
     }
     // create element
     return Html::el('p', array('class' => 'help-block'))->{$error instanceof Html ? 'add' : 'setText'}($error);
 }