开发者

Problem with paging when using query string in codeigniter

开发者 https://www.devze.com 2023-02-19 16:25 出处:网络
i am using query string to search in codeigniter. my url is like http:开发者_如何学C// localhost/testing/main?serch=res

i am using query string to search in codeigniter. my url is like

http:开发者_如何学C// localhost/testing/main?serch=res

but my paging is like

http: //localhost/testing/main/10

now i want to attach "?serch=res" with paging

http: //localhost/testing/main/10?serch=res

how can i attach please help


If you're willing to use segments you could format your url like so:

http: //localhost/testing/main/res/10

then to access your serch and pagination parameters it would be:

$serch = $this->uri->segment(2);
$per_page = $this->uri->segment(3);

http://codeigniter.com/user_guide/libraries/uri.html

0

精彩评论

暂无评论...
验证码 换一张
取 消