public function getError() {
        if ($this->error) {
            return $this->translate($this->error);
        }
        if ($this->form->model && is_object($this->form->model) && $this->form->model->hasErrors($this->name)) {
            $errors = $this->form->model->getErrors($this->name);
            foreach ($errors as &$message) {
                $message = $this->translate($message);
            }
            return $errors;
        }
        return null;
    }
public function getError() {
        if ($this->error) {
            return $this->translate($this->error);
        }
        if ($this->form->model && is_object($this->form->model) && $this->form->model->hasErrors($this->name)) {
            $errors = $this->form->model->getErrors($this->name);
            foreach ($errors as &$message) {
                $message = $this->translate($message);
            }
            return $errors;
        }
        return null;
    }
public function getError ( ) { if ( $ this -> error ) { return $ this -> translate ( $ this -> error ) ; } if ( $ this -> form -> model && is_object ( $ this -> form -> model ) && $ this -> form -> model -> hasErrors ( $ this -> name ) ) { $ errors = $ this -> form -> model -> getErrors ( $ this -> name ) ; foreach ( $ errors as & $ message ) { $ message = $ this -> translate ( $ message ) ; } return $ errors ; } return null ; }
Return a simple text message or a list of messages with errors for current field
@return string|string[]|null
Return a simple text message or a list of messages with errors for current field