Welcome Guest, Not a member yet? Register   Sign In
pagination links
#1

[eluser]insub2[/eluser]
From the CI library:
Code:
// Write the digit links

for ($loop = $start -1; $loop <= $end; $loop++)

{

    $i = ($loop * $this->per_page) - $this->per_page;

            

    if ($i >= 0)

    {

        if ($this->cur_page == $loop)

        {

            $output .= $this->cur_tag_open.$loop.$this->cur_tag_close; // Current page

        }

        else

        {

            $n = ($i == 0) ? '' : $i;

            $output .= $this->num_tag_open.'<a >base_url.$n.'">'.$loop.'</a>'.$this->num_tag_close;

        }

    }

}

What is the point of having the number displayed and the page number that is actually linked to be different?
#2

[eluser]TheFuzzy0ne[/eluser]
I asked myself the same question. I came to the conclusion that it gives you more flexibility, so you don't have to make your model aware of how to paginate. Instead, it would only need to be fed the starting result, and the offset, not a page number.




Theme © iAndrew 2016 - Forum software by © MyBB