Cakephp 3 : How to receive get request data?
问题 I have written ajax to send search key, I have tried below code $.ajax({ method:'GET', url:'<?php echo Router::url(['action' => 'product_search']); ?>', data:{search:search}, success: function(data) { $('.fetch-data').html(data); } }); Then I have received it in product controller like if ($this->request->is(['get'])) { $search = $this->request->data('search'); } Here $search is null. If I use POST in here then it's working fine. How can I receive this data by get method ? 回答1: Used below