/** * Add/Delete Bookmark with AJAX. */ public function actionAjaxBookmark() { $model = $this->loadPost(); echo Bookmark::addDel($model->id) ? Yii::t('lan', 'Delete') : Yii::t('lan', 'Add'); }
/** * Add/Delete Bookmark with AJAX. */ public function actionAjaxBookmark() { $post = $this->loadPost(); $post->refresh(); echo Bookmark::addDel($post->id) ? Yii::t('lan', 'Delete') : Yii::t('lan', 'Add'); }