Welcome Guest, Not a member yet? Register   Sign In
pagination "View all" link
#1

[eluser]voxy[/eluser]
Hi,

It is possible to add a "view All results" link after or before the << First 1 2 3 Last >> links of the pagination?

I tried some thing like :

// in controller (search) :
Code:
if(uri_string()=='/search/results/all'){
            $config['per_page'] = $config['total_rows'];
        }else{
            $config['per_page'] = 10;
        }
$page['pagination'] = $this->pagination->create_links();
// and in the view :
Code:
echo $pagination .' '. '<a href="/search/results/all">View all results</a>'; // actualy, I used the function href() like: a href="'.href("/search/results/all").'" it didn't work otherwise
So then, everything is ok and I have : << First 1 2 3 Last >> View all Results. But when we are in the search/result/all page, the $config['per_page'] equals now $config['total_rows'], so I have all my results in the same page as i wanted, but obviously
Code:
echo $page['pagination']
doesn't print anything.

Does anyone knows a better way?
#2

[eluser]cmgmyr[/eluser]
Feel free to check out my Pagination Library, it has a "View All" option along with some others.




Theme © iAndrew 2016 - Forum software by © MyBB