search with pagination: POST first, then GET? |
[eluser]Unknown[/eluser]
First of all, thanks to all the contributors to this forum I've found it invaluable in my first CI project! Ok, so I have a search page with pagination running fine http://www.mysite.com/jobs/search/css:html/london http://www.mysite.com/jobs/search/css:html/london/4 etc; I might change it to http://www.mysite.com/jobs/search/for/cs...n/offset/4 and then use $this->uri->uri_to_assoc(n) if it helps my problem below. But what I'm not sure about is when I want to call this URL from a simple search form on the same page. Should I use a GET method on the form and then try and turn http://www.mysite.com/jobs/search?for=cs...n&offset=4 into http://www.mysite.com/jobs/search/for/cs...n/offset/4 using htaccess or the routing feature of CI? or should I use some logic in the controller to check if it was a POST or GET it's further comlicated because I would like to use the validation library to check if the fields are empty. Any advice greatly appreciated, Thanks. This is the method in my controller Code: function search()
[eluser]gon[/eluser]
One thing I wouldn't do is using validation for checking if URL fields are empty. URI segments are also passed to the action function. And you can check if they're empty this way: Code: function search($arg1 = null, $arg2 = null, $arg3 = null) { |
Welcome Guest, Not a member yet? Register Sign In |