[eluser]developer10[/eluser]
Well, although i knew moving from native PHP to CodeIgniter wasn't going to be an easy mission, i didn't expect not to be able to manage somewhat basic things.
long story short, im rebuilding my site (native PHP) in CI. the site URLs are based on query strings. basically, these are examples of links and the same i want to achieve in CI:
the site is BUSINESS DIRECTORY - filtering is possible by area of business (category), company city (city), company first letter (letter) and also, there's pagintion parameter (page)
mysite.com/show.php?section=bizdirectory // all companies are listed
mysite.com/show.php?section=bizdirectory&category=Banks // only banks are listed
mysite.com/show.php?section=bizdirectory&category=Banks&letter=P // only banks beginning with "P" are listed
mysite.com/show.php?section=bizdirectory&&category;=Banks&letter=P&page=2 // if there are many results, "page" gets involved
The same goes for involving "
city" parameter, i'll show some examples to get an idea
mysite.com/show.php?section=bizdirectory&category=Banks&city=Sarajevo // only banks from Sarajevo are listed
mysite.com/show.php?section=bizdirectory&category;=&city=Sarajevo // all companies from Sarajevo are listed (note empty value for the category parameter)
etc, etc (adding "letter" and page parameters in any possible way) The main thing is that parameters go in this order:
category, city, letter, page, and if needed, parameters (not only values) from the end can be omitted
Basically, this is what i want to achieve in CI. So far, i managed to do this:
mysite.com/index.php/bizdirectory EQUALS TO mysite.com/show.php?section=bizdirectory // all companies listed
( USING ONE FUNCTION within bizdirectory_model )
AND
( USING another FUNCTION within bizdirectory_model )
mysite.com/index.php/category/Banks (using routing) EQUALS TO mysite.com/show.php?section=bizdirectory&category=Banks // only banks listed
Since i suppose there's an easy way to achieve everything i need/want in CI, please be so kind and give me some suggestions
Thanks!