Validation error

Contains all the information about a validation error

package Fuel
category Core

 Methods

Constructor

__construct(\Fuel\Core\Fieldset_Field $field, mixed $value, array $callback, array $params) 

Parameters

$value

mixed

value that failed to validate

$callback

array

contains rule name as key and callback as value

$params

array

additional rule params

Generate the error message

__toString() : string

Returns

string

__wakeup()

__wakeup() 

inherited_from Exception::__wakeup()

Load validation Language file when errors are thrown

_init() 

getCode()

getCode() 

inherited_from Exception::getCode()

getFile()

getFile() 

inherited_from Exception::getFile()

getLine()

getLine() 

inherited_from Exception::getLine()

getMessage()

getMessage() 

inherited_from Exception::getMessage()

getPrevious()

getPrevious() 

inherited_from Exception::getPrevious()

getTrace()

getTrace() 

inherited_from Exception::getTrace()

getTraceAsString()

getTraceAsString() 

inherited_from Exception::getTraceAsString()

Get Message

get_message(string $msg, string $open, string $close) : string

Shows the error message which can be taken from loaded language file.

Parameters

$msg

string

HTML to prefix error message

$open

string

HTML to postfix error message

$close

string

Message to use, or false to try and load it from Lang class

Returns

string

Replace templating tags with values

_replace_tags(mixed $msg) : string

Parameters

$msg

mixed

error message to parse

Returns

string

 Properties

 

<p>the field that caused the error</p>

$field : \Fuel\Core\Fieldset_Field

 

<p>variables passed to rule other than the value</p>

$params : array

 

<p>validation rule string representation</p>

$rule : string

 

<p>value that failed to validate</p>

$value : mixed