I want to create my custom generic validation page in cakephp 3.8. and access the functions through model in same way as cakephp does. I just want to create some some functions in a different page, that is accessible from any model.
It’s not clear what you’re trying to do. Can you share some example code that you’ve written towards this goal and explain what part you’re struggling with? Or give some more specific details about your idea?
I want to validate my entity according to my own function.
For example I want to check “Identification No” according to my own function in model.
$validator
->MyOwnValidationFunction(‘id’);
Now, I have an option to define ‘MyOwnValidationFunction’ in same model. But in that case i wont be able to use this function in another model. To avoid such situation I want to create a separate page to define such validation functions that are accessible through all models.
What is stopping you from implementing them? Without knowing specifically what is going wrong, it’s hard to help. The forums are for help with specific issues, not for writing your code for you; anyway, we have no idea what you want your validation code to do. Show us what you have tried, and explain what’s not working about it (including exact error messages if applicable).