public function actionViewReceived($id = null)
    {
        $model = MessageReceiver::find()->where([
                'and',
                ['id' => $id, 'receiver_id' => User::loggedId()],
                ['!=', 'receiver_status', MessageReceiver::STATUS_DELETED]
            ])->limit(1)->one();
        if (empty($model)) {
            $this->error(Yii::t('podium/flash', 'Sorry! We can not find the message with the given ID.'));
            return $this->redirect(['messages/inbox']);
        }
        $model->markRead();
        return $this->render('view', [
            'model' => $model->message,
            'type' => 'received',
            'id' => $model->id
        ]);
    }
public function actionViewReceived($id = null)
    {
        $model = MessageReceiver::find()->where([
                'and',
                ['id' => $id, 'receiver_id' => User::loggedId()],
                ['!=', 'receiver_status', MessageReceiver::STATUS_DELETED]
            ])->limit(1)->one();
        if (empty($model)) {
            $this->error(Yii::t('podium/flash', 'Sorry! We can not find the message with the given ID.'));
            return $this->redirect(['messages/inbox']);
        }
        $model->markRead();
        return $this->render('view', [
            'model' => $model->message,
            'type' => 'received',
            'id' => $model->id
        ]);
    }
public function actionViewReceived ( $ id = null ) { $ model = MessageReceiver :: find ( ) -> where ( [ 'and' , [ 'id' => $ id , 'receiver_id' => User :: loggedId ( ) ] , [ '!=' , 'receiver_status' , MessageReceiver :: STATUS_DELETED ] ] ) -> limit ( 1 ) -> one ( ) ; if ( empty ( $ model ) ) { $ this -> error ( Yii :: t ( 'podium/flash' , 'Sorry! We can not find the message with the given ID.' ) ) ; return $ this -> redirect ( [ 'messages/inbox' ] ) ; } $ model -> markRead ( ) ; return $ this -> render ( 'view' , [ 'model' => $ model -> message , 'type' => 'received' , 'id' => $ model -> id ] ) ; }
Viewing the received message of given ID.
@param int $id
@return string|Response
Viewing the received message of given ID .