Let's assume you need to validate an email that is not a part of model Entity. If it was a field in model, the validation rules in model would have taken care of it. But in this case, you need to validate the email address yourself. So, what will you use? A regex ? No, instead you can use the Validation class of Cake.
It's simple :
First insert the below line in your controller or Model :
use Cake\Validation\Validation;
This will include the validation class in your file.
Now use the below line in your function :
$check=Validation::email('email to be validated');
If $check is true, then it's a valid email else the email is invalid.
it's such a nice information for validation about cakephp.it's a most valuable information for cakephp users. more information about cakephp click here school signs uk
ReplyDeleteThanks for sharing such a great blog..Keep posting..Very informative post
ReplyDeleteClean and neat blog.
ReplyDeleteNice Article, Thanks for writing such informative post.
ReplyDeleteIf your looking for cakephp interview questions please refer to
Cakephp Interview Questions
Actually i want to verify email address that's why i was looking a great website where i can get information about it. I think this website is very helpful for me because here already i got more information about it. I hope next time i will get another valuable information here. Thanks for your great post.
ReplyDeleteSuperbly written article, if only all bloggers offered the same content as you, the internet would be a far better place.. http://verifications.io
ReplyDeleteHi,
ReplyDeleteThank you so much for share your thoughts. I will definitely appreciate your ideas about CakePHP Development Company .
CakePHP Development
Aapthi Technologies USA
Ecommerce Web Development Company
This comment has been removed by the author.
ReplyDeleteThanks for sharing such a nice information with us on PHP and related topics. Very useful lines and to the point. I appreciate your effort , keep sharing such wonderfull things.
ReplyDeletehttps://www.interviewsortout.com/in-how-many-ways-we-can-use-model-in-cakephp/