本文整理汇总了PHP中AbstractValidator::errors方法的典型用法代码示例。如果您正苦于以下问题:PHP AbstractValidator::errors方法的具体用法?PHP AbstractValidator::errors怎么用?PHP AbstractValidator::errors使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类AbstractValidator
的用法示例。
在下文中一共展示了AbstractValidator::errors方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: __callStatic
/**
* This function routes all requests to the validation methods.
*
* If validation method does not exist false will be returned.
*
* Optional elements will be checked before executing the validation callback.
* The following values are considered as empty: false, null and an empty string or array.
*
* The arguments array has to be in the following order:
* The First argument should be the optional state, the second state the value followed by the
* arguments for the calles function.
*
* @see empty()
* @param string Function name
* @param array Arguments for the function
*/
public static function __callStatic($name, $arguments) {
self::$errors = array();
if ($name[0] == '_') {
$name = substr($name, 1);
}
// Use Late static binding because __CLASS__ would contain AbstractValidator
if (method_exists(get_called_class(), $name) == true) {
// Optional check
if ($arguments[1] == true && ($arguments[0] === false || $arguments[0] === null || $arguments[0] === '' || $arguments[0] === array())) {
return true;
}
return call_user_func_array("static::{$name}", $arguments);
}
else {
return false;
}
}