|Validate get params [message #103195]
||Wed, 28 July 2010 15:31
Registered: July 2010
I come from symfony 1.0 and there are some issues that i have to deal with...
The probably most important that I have is how to validate get params that I did validate with a YAML file.
Here is an explaination on what I want do do :
I am developing an API which will offer services such like account creation and login. Concerning the login action (api/login), I would like it to be called using a URL like mydomain.com/api/login.json?nickname=nick&password=pass.
However, the form validation in symfony 1.4 seems to have replaced every validation process that did exist in symfony 1.0. So I wonder how I can make sure the nickname exists in the database and how I can check if the nickname and password are provided by the user calling the API, knowing that all this requirements should not be checked in the action...
The solution I have found is to create a LoginForm with widgets and validators, even if it is used only to validate the url, but I am not sure it is the best pratice to do it.
[Updated on: Wed, 28 July 2010 19:41]