Brimbox Logo Brimbox Version 2.3.4 Released


Method to check if a string is populated, usually used when inputting data.

Class: bb_main, called as $main

File: bb_main.php (php)


function validate_required(&$field, $error = false)


$test = $main->validate_required(&$field, $error = false);

Returns: Error message string or boolean true on error, false on successful validation.

Parameter: $field (string)
Field to be validated, passed as a value because it is trimmed and validated at the same time.

Parameter: $error (boolean)
If $error is true, will return the error message string on required error. If $error is false, will return true on required error. Method always returns false on successful validation.

Updated: 2016-06-16