here is my code :
`id") . '" data-quotation="' . $row->id_quotation . '">Edit`
my ajax :
`$(document).on('click', '.edit', function() {
var quotation = $(this).attr('data-quotation');
$.ajax({
type: 'POST',
dataType: 'json',
url: baseurl + 'purchase/senddata/' + quotation,
data: {
'quotation': quotation
},
success: function(data) {
window.location = url;
}.then(function() {
})
});
});
`
this my Controller :
public function edit_data($id)
{
$id_quotation = $this->request->getVar('quotation');
$data = [
'title' => 'Edit Purchase Order',
'invoice' => $this->purchases->getPurchase($id),
'dataQuotation' => $this->purchases->getQuotationById($id_quotation)
];
dd($id_quotation);
return view('purchase-order/edit-data', $data);
}
and this my routes :
$routes-\>post('purchase/senddata/(:segment)', 'Purchase::edit_data/$1');
on my controller there I do a var_dump but the value is always null
from the way I tried to do it above can someone be kind enough to tell me where I made a mistake in my code