问题描述
如果我的网址像这样: search /?我在传递URL
I am having trouble setting up pagination on codeigniter when I pass parameters in the URL
中的参数时无法在codeigniter上设置分页? type = groups
if my url is like this : search/?type=groups
应该是我的 $ config ['base_url']
分页工作?
如果我将基本URL设置为 search /?type = groups
code> search /?type = groups / 10
if i set the base url to search/?type=groups
the resulting url is search/?type=groups/10
这意味着 $ _ GET ['type'] = groups / 10
谢谢
推荐答案
解决方案是CodeIgniter不会像这样的功能。
我需要一个方法(在控制器中)为type
中的每个选项,因此一个选项将是一个称为的方法:groups,另一个称为条目等等
each方法是指根据需要使用不同的模型类或方法。
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 etceach method refers to a different model class or method as needed.
我想更好地理解OOP和CI ...有点调整做...评论和纠正我,如果我错了。
谢谢
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
这篇关于codeigniter分页url与获取参数的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!