src/ngrest/base/ActiveButton.php
public function sendError($message)
    {
        Yii::$app->response->setStatusCode(422, 'Data Validation Failed.');

        return [
            'success' => false,
            'message' => $message,
            'events' => $this->_events,
        ];
    }
public function sendError($message)
    {
        Yii::$app->response->setStatusCode(422, 'Data Validation Failed.');

        return [
            'success' => false,
            'message' => $message,
            'events' => $this->_events,
        ];
    }
public function sendError ( $ message ) { Yii :: $ app -> response -> setStatusCode ( 422 , 'Data Validation Failed.' ) ; return [ 'success' => false , 'message' => $ message , 'events' => $ this -> _events , ] ; }
Send an error message as response.

Events are only triggered on success messages {{sendSuccess()}}.

@param string $message The error message.
@return array
Send an error message as response .