Help in converting vanilla PHP to CI (AJAX + filter + infinity scroll) - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Using CodeIgniter (https://forum.codeigniter.com/forumdisplay.php?fid=5) +--- Forum: General Help (https://forum.codeigniter.com/forumdisplay.php?fid=24) +--- Thread: Help in converting vanilla PHP to CI (AJAX + filter + infinity scroll) (/showthread.php?tid=70310) |
Help in converting vanilla PHP to CI (AJAX + filter + infinity scroll) - castle - 03-23-2018 I'm trying to convert this PHP tutorial to CI Product Ajax Search Filter With Infinite Scroll More Using PHP And Mysqli. But so far, no luck. I "think" my problem is the Javascript code, specially this part. Code: $.get("autoload.php?group_no="+total_record+"&brand="+brand+"&material="+material+"&size="+size, I don't know how to make this JS code CI friendly. I tried something like this, but it didn't work. Code: $.get(baseURL+'/index.php/home/filtered'+group_no="+total_record+"&brand="+brand+"&material="+material+"&size="+size) I'm after a kind of AJAX search/checkboxes filter with infinite scroll, but I found none implemented in CI. So, I'm trying to convert this tutorial to CI. Any tips or suggestions on how to do this? Regards, Castle RE: Help in converting vanilla PHP to CI (AJAX + filter + infinity scroll) - jreklund - 03-23-2018 https://www.codeigniter.com/user_guide/general/controllers.html#passing-uri-segments-to-your-methods Code: $.get(baseURL+'/index.php/home/filtered/'+total_record+'/'+brand+'/'+material+'/'+size) PHP Code: <?php RE: Help in converting vanilla PHP to CI (AJAX + filter + infinity scroll) - castle - 03-23-2018 Thanks @jreklund. I'm wondering if would be better if I use JSON(serialize) to pass the data from AJAX to the controller? RE: Help in converting vanilla PHP to CI (AJAX + filter + infinity scroll) - jreklund - 03-23-2018 That's something I would do. It's easier to extend. RE: Help in converting vanilla PHP to CI (AJAX + filter + infinity scroll) - castle - 03-23-2018 Could you give an example? RE: Help in converting vanilla PHP to CI (AJAX + filter + infinity scroll) - jreklund - 03-23-2018 PHP Code: <?php Code: $.ajax({ RE: Help in converting vanilla PHP to CI (AJAX + filter + infinity scroll) - castle - 03-23-2018 Thank you. |