Welcome Guest, Not a member yet? Register   Sign In
Help me in Pagination
#1

[eluser]Nisha S.[/eluser]
Hi,
I am trying to use Pagination, but the pagination is always being generated at the top even if I add it after some views such as header and content views. But when I view in the generated html output it is always in the first place. Any guess why?

Thank you in advance to the friend who is going to help me on this Smile
#2

[eluser]Johan André[/eluser]
[quote author="Nisha S." date="1250550649"]Hi,
I am trying to use Pagination, but the pagination is always being generated at the top even if I add it after some views such as header and content views. But when I view in the generated html output it is always in the first place. Any guess why?

Thank you in advance to the friend who is going to help me on this Smile[/quote]

My wild guess is that you probably use an echo-statement to output the pagination-links before loading the views...
#3

[eluser]Nisha S.[/eluser]
Thank for the reply.

But actually I am loading the view before that echo. Only I sent the footer view last. Please see my coding below.

function page($page)
{
$this->load->view('header');
$this->load->view('wire_form_view');
$query = $this->db->get('microposts');
$data['query'] = $query;
$data['title'] = 'Nisha';
$this->load->view('wire_post_view',$data);
$this->load->library('pagination');
$config['base_url'] = base_url() . 'index.php/wire/page';
$config['total_rows'] = '200';
$config['per_page'] = '5';
$config['full_tag_open'] = '<div class="aa">';
$config['full_tag_close'] = '</div>';
$this->pagination->initialize($config);
echo $this->pagination->create_links();
$this->load->view('footer');
}


Regards,
Nisha S.
#4

[eluser]Nisha S.[/eluser]
Thanks any way, I managed to complete this by putting the pagination links inside the view rather than using echo in controller. If I use echo in controller that will be send as the out put first and the the view is sent after the echo statement even if it is loaded before the echo in controller.




Theme © iAndrew 2016 - Forum software by © MyBB