I´ve got a form, with several fields, when I push about click event button execute:
$("#box-modal").on("shown",function(event)
{
$("button#add-cart").click(function(e)
{
$.ajax({
type:'POST',
url: '/lineorder/addCart/'+valueidproduct,
data: $("#form-product").serialize()
});
}
I get the response network
http://localhost:8080/lineorder/addCart/2
type: POST
status: 200 OK
My call go to the route of slim /lineorder/addCart/2
$app->post('/lineorder/addCart/:id',function($id) use($app)
{
var_dump("hi");die();
if(isset($_POST['add-cart']))
{
$nombre = $app->request()->post('inputnombre');
var_dump($nombre);die();
}
}
How I cand Try the variable inside my route with var_dump(), for view it´s work not? but I do var_dump("hi"); and don´t appear any response?