  <div class="modal-dialog" role="document">
    <?= form_open('admin/RolePermissions/edit_permission', ['id' => 'permission-edit-form']) ?>
    <input type="hidden" name="id" id="edit-permission-id">
    <div class="modal-content card-outline-info">
              <div class="card-header text-white text-center">Edit permission</div>

      <div class="modal-body">

        <div class="form-group">
          <label for="edit-controller" class="small">Controller</label>
          <input type="text" name="controller" id="edit-controller" class="form-control" required>
        </div>

        <div class="form-group">
          <label for="edit-method" class="small">Method</label>
          <input type="text" name="method" id="edit-method" class="form-control" required>
        </div>

        <div class="form-group">
          <label for="edit-label" class="small">Label</label>
          <input type="text" name="label" id="edit-label" class="form-control" required>
        </div>
        <div class="form-group text-right">
          <button type="submit" class="btn btn-info">Update</button>
        </div>
      </div>
      
    </div>
    <?= form_close(); ?>
  </div>

<script src="https://code.jquery.com/jquery-3.6.0.min.js"></script>

<script type="text/javascript">
    $(document).ready(function() {
    $('.permission-edit-modal').on('click', function() {
        var id = $(this).data('id');
        var controller = $(this).data('controller');
        var method = $(this).data('method');
        var label = $(this).data('label');

        $('#edit-permission-id').val(id);
        $('#edit-controller').val(controller);
        $('#edit-method').val(method);
        $('#edit-label').val(label);

        $('#permissionEditModal').modal('show');
    });
});

</script>