开发者

Symfony backend: specific test on field before insert

am using the symfony's admin generator, in the "new" interface, i have on开发者_运维百科e specific field that i want to test before insert into database, and if it doesn't pass i return the user to the same interface until he gets the right value ! can any body tell me how it can be done?

for the one who voted down on my question : am not looking for a simple validator, what i want is that a url field i check whether it IP existe in my DB and then add it (avoid adding all external urls)


Reading your question an your comment on the negative vote, is clear that you need a custom validator class. You need to create a custom validator [link] and make it do what you want it to do.

What I understood from your question, is that you want to get the IP address from a URL and check if the IP address exists in the DB, Symfony doesn't have a built in validator for something like this. That is why you need to create the validator yourself.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜