Ain
319
9
Laravel

How to set condition into button

Posted 4 months ago by Ain

I dont want to use if else, is there any other way to set condition into button?

@if ($i > 0)

                       <button title="Remove Field" type="button" name="remove" id="{{$i}}" class="btn btn_remove btn-danger ">Remove Group Member</button>

                   @else

                       <button title='Add Author' type="button" name="add" id="add" class="btn btn-primary ">Add Group Member</button>

                   @endif

Please sign in or create an account to participate in this conversation.