Category: ajax

How can I get my datatable via ajax request?

I try to load my datatable via Ajax: base.html.twig: <button class=”button”>load table</button> <div class=”result”></div> $(‘.button’).on( ‘click’, function () { $.ajax({ method:’POST’, data: { “id”: id, }, url:'{{ path(‘table’) }}’, success : function (data) { $(“.result”).html(data.output); } }); }); Controller: /**…

Symfony 4 – Submit form with Axios?

With Axios I get a form created with Symfony FormBuilder, which I then display in a modal: template.html.twig: productId = {{product.id}}; var url = Routing.generate(“stripe_admin_product_update_form”, {id: productId}); axios.get(url) .then(function(response){ var form = response.data.form; Swal.fire({ title: “Modifier ?”, html: form, icon:…