Home >Backend Development >PHP Tutorial >yii2 How to customize the error message format returned by AR validation?

yii2 How to customize the error message format returned by AR validation?

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOriginal
2016-07-06 13:53:13891browse

For example:
yii2 How to customize the error message format returned by AR validation?

yii2 How to customize the error message format returned by AR validation?
I don’t want the returned array to contain key 'user_id' . Is there any way to customize it?

Reply content:

For example:
yii2 How to customize the error message format returned by AR validation?

yii2 How to customize the error message format returned by AR validation?
I don’t want the returned array to contain key 'user_id' . Is there any way to customize it?

array_values($order->getFirstErrors())
Is this okay?

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn