Exemplo n.º 1
0
 public function handleLikeArticle($id)
 {
     if ($this->user->isAllowed('Article', 'like') && $this->articleDetail->user_id != $this->user->id) {
         if ($this->articleManager->userLikeArticle($id, $this->user->id)) {
             // todo: if ajax, redraw component
             $this->redirect('this');
         } else {
             $this->flashMessage('Only one like for article is allowed', 'danger');
             $this->redirect('this');
         }
     }
 }