Welcome Guest, Not a member yet? Register   Sign In
Pagination URLS..
#1

[eluser]mgandha[/eluser]
Hi all,
i have been playing around with CI pagination and following freakauth's examples i see that they were able to default the index function with a parameter.

example:
path/to/controller.php/xyz

will run index function in controller.php passing param xyz.

However it did not work in my version of the controller... I suspect there is a access script of somesort which routes this logic. I am almost certain code wise there is no diff what im doing than what freakauth is doing however i cant get it to work.

if i call path/to/controller/index/zyx it works fine..

please advise.
#2

[eluser]m4rw3r[/eluser]
Read the URI Routing in the manual.
If you use an address like this www.something.com/news it will call the index() method.
But if you call it like this www.something.com/news/10/20 (numbers from ex. pagination), CI will try to call a method with the name 10().
To prevent this, you can use the routes.php config file to route calls to a specific controller and/or method:
Code:
$route['news/.*'] = 'news/index';
#3

[eluser]mgandha[/eluser]
AHAAAA... thank you that is very helpful..




Theme © iAndrew 2016 - Forum software by © MyBB