/** * Creates the Wall Widget */ public function run() { return $this->render('notifications', array('newMailMessageCount' => UserMessage::getNewMessageCount())); }
/** * Returns the number of new messages as JSON */ public function actionGetNewMessageCountJson() { Yii::$app->response->format = 'json'; $json = array(); $json['newMessages'] = UserMessage::getNewMessageCount(); return $json; }