/** * Returns the number of new messages as JSON */ public function actionGetNewMessageCountJson() { $json = array(); $json['newMessages'] = UserMessage::getNewMessageCount(); header('Content-type: application/json'); echo CJSON::encode($json); Yii::app()->end(); }
/** * Creates the Wall Widget */ public function run() { $this->render('mailNotifications', array('newMailMessageCount' => UserMessage::getNewMessageCount())); }