In a controller, I need to check a string to see if it is a valid email address. Is there an existing method in Cake that I can use to check this?
It has nothing to do with models, so I don't want to use a validate array.
I found the core Validation class. Validation::email()
App::uses('Validation', 'Utility');
class MyController extends AppController
{
public function myAction()
{
$isValid = Validation::email('[email protected]'); // Returns true or false
}
}