Symfony2 data transformers, getting exception message

后端 未结 1 414
北海茫月
北海茫月 2021-01-22 15:06

I\'ve created my own data transformer, as explained in the dedicated cookbook, here is my reverse transformation:

public function reverseTransform($val)
{
    //         


        
相关标签:
1条回答
  • 2021-01-22 15:51

    Sort answer is: You don't. The transformers job is to, well, transform and not to do error checking.

    Add a constraint to the field which will check the transformed value and take care of error messaging.

    0 讨论(0)
提交回复
热议问题