frontend\controllers\IController::actionSendMsg PHP Method

actionSendMsg() public method

public actionSendMsg ( )
    public function actionSendMsg()
    {
        $model = new ChangeMobileSendRequestForm();
        Yii::$app->response->format = Response::FORMAT_JSON;
        $model->mobile = Yii::$app->request->post('mobile');
        $message = '';
        if ($model->sendMsg()) {
            return ['status' => 'ok'];
        } else {
            $message = $model->getFirstError('mobile') or $message = '验证码发送失败,请稍后再试!';
        }
        return ['status' => 'err', 'message' => $message];
    }