Well then but the contents of mycustom_check directly inside the string instead, does that not work?
like:
PHP Code:
$string =
' /* Do some long check */
if($data != "something")
{
/*$this->error("You cant do this or something()*/
}
else
{
return true;
}
';
$this->validfields['fieldname'] = array(TYPE_STR, REQ_NO, $string);
Does that not work? Does it generate errors or something? Have you test your validation code independently to ensure that it works in the first place?
Or:
PHP Code:
function mycustom_check($data)
{
// Some long code here
// ....
// ....
// ....
// return true/false
}
$this->validfields['fieldname'] = array(TYPE_STR, REQ_NO, 'if(!mycustom_check($data)) { $this->error("Some error message!");} ');
How about that? (If you only need to use the error method).
What are you checking for/validating for? Is there not already a validation method in the Base Datamanager?