required()
required(string $a, array|string $b = 'NULL') : boolean
Public method for check_required
A mirror for check_required Logic of initial function, but instead of false it throws exception
Parameters
| string | $a | Comma-separated (with spaces) required keys |
| array|string | $b | Array to be checked. If === 'NULL' - it checks $secure global |
Throws
- \apiException
[102] If there's no one or more required keys
Returns
boolean —True if everything is OK
Examples
Fields could be required by statements
// Require variables by statements
if (isset($secure['require_test'])) { // If client wants to test field-requiring
api::required("int_value, str_value");
// .... ^ Space is important
}