N00b question:
I'm using Symfony with Doctrine. I have a form where I've added a little Jquery & Ajax check of whether a username that has been inputted into the form already exists. The jQuery calls a short PHP script on my web root that does the MySQL database check and returns true/false, which is then used to determine what error message to show.
However, if possible, I'd like to move the database call to a symfony helper function that then returns the true/false, rather having all the connection info etc on my web root. But I can't seem to be able to call the helper function correctly - all other components of the functionality work fine.
This is what I've got in my little php script:
$availability = GenericHelper::checkUsername(); // a public static function
echo $availability; // returns true/false to Jquery
Anyone? Thanks.