salmane salmane - 1 month ago 16
PHP Question

codeigniter pagination url with get parameters

I am having trouble setting up pagination on codeigniter when I pass parameters in the URL

if my url is like this :

search/?type=groups


what should be my
$config['base_url']
for pagination to work?

if i set the base url to
search/?type=groups
the resulting url is
search/?type=groups/10


which means
$_GET['type']=groups/10


thank you

Answer

The solution is that CodeIgniter does not function like that. what I need is a method ( in the controller ) for each one of the options in "type" so one option would be a method called :groups , another called entries etc etc each method refers to a different model class or method as needed.

I am trying to better understand OOP and CI ...a bit of adjusting to do ... feel free to comment and correct me if i am wrong. thank you