Right now my website is set up to redirect to controller name home.
So basically when I type http://www.domain.com/home or http://www.domain.com I will end up in home controller.
Now in that controller // page I am loading some tables from database – that data will require pagination from time to time. which mean the link of the pagination is :
http://www.domain.com/home/3/
Now the way I have it set up when this address is being accessed CI goes to home controller and look for function name 3.
My question is:
is there a way to make it so CI will treat the 3 as a variable instead of a functions.
Also is there a way to do it just for that section of the website (I am asking this because I have my whole admin panel set up already with the normal “www.domain.com/admin/function/variable” )
This is how i solved the problem:
After reading some more i learned that i can route address to certain controllers/functions.
It appeared that at the config files(application/config/routes.php) there is a routing file and by adding a line or two to that file my problem was solved
I added the following line: $route[‘home/(:num)’] = “home”; which redirect home/number to home.
There are many ways of doing it however the above works fine for me.
For full explanation about routing at :
Hope that help other Codeigniters.