Welcome Guest, Not a member yet? Register   Sign In
Controller question
#3

[eluser]Assim[/eluser]
[quote author="samota" date="1266803131"]Keep in mind that (depending on your rerouting) the CI follows controller/function method in its uri calls. So, if you want to call pagelist, you need to have a function within your controller called page_list(or something similar)... so when your uri looks like this http://www.examples.com/pages/page_list, this will call the function page_list within your controller called Pages. Or you can build a routing to have everything after pages passed as variable, but then you may want to have something like http://www.examples.com/pages/page_list/1, this way your pages controller will have a uri array as [page_list]=1 and then you can use

if( !empty(page_list) ){ do someting }[/quote]
But I'm using the _remap function as described here:
http://ellislab.com/codeigniter/user-gui...#remapping

So it takes the controller as the first segment, and the other segment are taken as parameters in the _remap function.

I can make it as http://example.com/pages/list instead but I'd prefer http://example.com/pages instead since it's easier to type in the address bar.


Messages In This Thread
Controller question - by El Forum - 02-21-2010, 12:51 PM
Controller question - by El Forum - 02-21-2010, 01:45 PM
Controller question - by El Forum - 02-21-2010, 01:51 PM
Controller question - by El Forum - 02-21-2010, 02:13 PM
Controller question - by El Forum - 02-22-2010, 02:17 AM



Theme © iAndrew 2016 - Forum software by © MyBB