댓글에 필요한 버튼을 하나 추가해서 달았는데

이 버튼을 댓글에 대댓글이 달렸을 시에만 나타나게 하고 싶어서

if문을 넣어보려는데 어떻게 해야할지 잘 모르겠어요ㅠ,ㅠ

 

제가 해본건 

<!--@if(abs($comment->get('comment_count'))>=1)-->

이렇게 넣어봤는데 안되더라고요....ㅠ.ㅠ

도움 부탁드립니다

 

 

 

  • profile

    대댓글이 있는 경우 수정불가하는 팁을 보시면..
    https://xetown.com/lakepark/99286

    코드가 있는 듯 합니다.
    {@
    $oCommentModel = getModel('comment');
    $commentCount = $oCommentModel->getChildCommentCount($obj->comment_srl);
    }

    <!--@if($commentCount>=1)-->


    이렇게 해주면 되지 않을까요??

  • profile ?
    해봤는데 대댓글 달린 댓글에서도 버튼이 사라져요ㅠ.ㅠ ㅠ.ㅠ
  • ? profile
    이 코드를 그냥 쓰면 안될 것 같은 생각이 들기도 하네요..

    $obj->comment_srl

    이부분이 살짝 이상해 보이네요.
  • ? profile
    {@
    $oCommentModel = getModel('comment');
    $commentCount = $oCommentModel->getChildCommentCount($comment->comment_srl);
    }

    이렇게 하면 되네요.
  • profile ?
    감사합니다! 적용됐어요ㅠ.ㅠ!