Class validatorOptions not found
Class validatorOptions not found
In Editor v1.8.1 (php v7.2) I'm getting the following error when trying to call ValidateOptions: "Uncaught Error: Class 'ValidateOptions' not found in..."
Here's the code:
Field::inst( 'candidates.email' )
->validator( Validate::email(
ValidateOptions::inst()
->allowEmpty( false )
->optional( false )
) ),
However, Validate works as expected. For example:
Field::inst( 'candidates.email' )
->validator( Validate::email() ),
I can see the ValidateOptions.php file in the Editor folder and the code looks ok. Any ideas?
This question has an accepted answers - jump to answer
This discussion has been closed.
Answers
Have you got
DataTables\Editor\ValidateOptions;
in youruse
statement? e.g.:Without that you would need to specify the full namespace:
Allan