hi all i have a list of notification ! what i want to do is when i click on a notification on the index to view it her statut will be changed on the databese from unread to read !! thx
hi all i have a list of notification ! what i want to do is when i click on a notification on the index to view it her statut will be changed on the databese from unread to read !! thx
use like this in your views
/**
* Displays a particular model.
* @param integer $id the ID of the model to be displayed
*/
public function actionView($id)
{
$model = $this->loadModel($id);
// change your status to read or similar and save then finally render the view
$model->status = 'read';
$model->update(array('status'));
$this->render('view',array(
'model' => $model,
));
}
you are first load the notification into $model then chenge your model’s attribute to fit your needs and update your changed attributes then finally you render the view.