How i can display validation error message in webservice

强颜欢笑 提交于 2019-12-25 02:26:22

问题


I get validation error message in

$this->User->validationErrors;

But problem is when i assign like

DebugBreak();   //For debug my script
$response['type']='error';
$error = $this->User->validationErrors;

$response['message'] contains empty array. why this happen? help me.


回答1:


When I remove DebugBreak from my script then it work perfect like this

$response['type']='error';
$error = $this->User->validationErrors;


来源:https://stackoverflow.com/questions/22929323/how-i-can-display-validation-error-message-in-webservice

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!