The description on the validator creation screen says $value and $arg are the proper things to use in the PHP validator, but when I read the source, I see (lines 375-378)
$substitutes['%field'] = $element['#name'];
if (isset($arg)) {
$substitutes['%arg'] = $arg;
}
which is similar to what's in the regex validation case. What is the point of those in the PHP validator?
Comments
Comment #1
TapocoL commentedPHP uses eval(), so on line 362-365 on Rev 1.16 in validation_api.module:
So, these are the variables you can use in the eval of your rule/PHP Code. Case 'regex' uses the str_replace to replace %arg with the value of $arg.