Here i am going to explain the ajax custom pagination in cakephp 3.2.
This one is easier to use and understandable.
Do this code inside any function and any controller you need.
Make an ajax call for the pagination
<script type="text/javascript">
$(document).ready(function ()...