public function actionMarkRead($id) { $el = $this->getMessageElement(); if ($el->comments && $this->isSender(\Yii::app()->user)) { $this->markCommentRead($el); } else { $this->markMessageRead($el); } $this->redirectAfterAction(); }