As the title suggest, I’m looking for a way to validate emails (or other string formats) using the Symfony Framework (without having to use the Form Framework).
I’ve done some searching around, but every example given is using the Form classes…
And I know that I can use external classes or libraries, but I’m just curious if there is something that I could use from within Symfony that’ll work.
Something like this would be ideal:
$email = "email@to.validate";
$validator = new sfEmailValidator(); // just using this as an example - I know it doesn't work :p
$validator->check($email); // returns true or false if it validates
You should be able to do something like the following — you don’t need to use the form framework to use the validator framework: