error() public method

Gets the error message associated with a particular field
public error ( string $field, string $prefix = '', string $suffix = '' ) : string
$field string Field name
$prefix string HTML start tag
$suffix string HTML end tag
return string
Esempio n. 1
0
 function error($field = '', $prefix = '', $suffix = '')
 {
     if (!empty($this->_field_data[$field]) && $this->_field_data[$field]['is_array']) {
         return ($prefix ? $prefix : $this->_error_prefix) . array_shift($this->_field_data[$field]['error']) . ($suffix ? $suffix : $this->_error_suffix);
     }
     return parent::error($field, $prefix, $suffix);
 }
Esempio n. 2
0
 public function error($field, $prefix = '', $suffix = '')
 {
     if (!empty($this->_old_field_data[$field]['error'])) {
         if ($prefix === '') {
             $prefix = $this->_error_prefix;
         }
         if ($suffix === '') {
             $suffix = $this->_error_suffix;
         }
         return $prefix . $this->_old_field_data[$field]['error'] . $suffix;
     }
     return parent::error($field, $prefix, $suffix);
 }