Fuel\Validation\Result::getError PHP Method

getError() public method

Since: 2.0
public getError ( string $field ) : string
$field string
return string
    public function getError($field)
    {
        if (!isset($this->errors[$field])) {
            throw new InvalidFieldException($field);
        }
        return $this->errors[$field];
    }

Usage Example

Beispiel #1
0
 /**
  * @expectedException \Fuel\Validation\InvalidFieldException
  */
 public function testGetInvalidError()
 {
     $this->object->getError('test');
 }