Habari\FormContainer::errors_get PHP Метод

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

Return any validation errors on any controls in this container using the supplied format $this->validate must be called first!
public errors_get ( string $format, string $wrap = '%s' ) : string
$format string A sprintf()-style format string to format the validation error
$wrap string A sprintf()-style format string to wrap the returned error, only if at least one error exists
Результат string The errors in the supplied format
    public function errors_get($format, $wrap = '%s')
    {
        $out = '';
        foreach ($this->get_controls() as $control) {
            foreach ($control->errors as $error) {
                $out .= sprintf($format, $error);
            }
        }
        if ($out != '') {
            $out = sprintf($wrap, $out);
        }
        return $out;
    }