Esempio n. 1
0
 public function actionLike()
 {
     $post = Yii::$app->request->post();
     $photoId = $post['photoId'];
     $type = $post['type'];
     if ($type == 'photo') {
         Like::likePhoto();
     } else {
         Like::likePhotoClub();
     }
 }
Esempio n. 2
0
 public function actionLikes()
 {
     $articleId = Yii::$app->request->post('article_id');
     if (!Blog::isClosed($articleId)) {
         $response['error'] = 'Ви не авторизовані!';
         echo json_encode($response);
         die;
     }
     Like::likeArticle();
 }