I have a web application build on cakephp 2.x.
I have integrated pagination on my data.
Now i want to implement searching on that data also, and pagination should work according to search result.
Now my question is:
-
Should i use a form to post my search string. If so, then which method should i use, GET or POST.
-
OR, should i use javascript window.location method, and append the search string to it. If we use this method then search string can append more than once to url.
-
Or any other best way to implement this.
Can anybody give the best solution for this as it is a common task for each application to have.
To implement search in cakephp best way to implement is with form. You can use any method GET/POST but GET method is recommended as it’ll allow user to bookmark his search result.
Given below is the tutorial to implement search with pagination.
http://mrphp.com.au/blog/search-forms-cakephp