Welcome Guest, Not a member yet? Register   Sign In
Pagination problem, getting a blank page.
#1

[eluser]DustinH[/eluser]
I've been trying everything to get this pagination system to work, but everytime it comes up with a blank page, NOTHING is showing up and I've run outa options, can anyone see something that I cant?

Controller
Code:
<?php
session_start();
class Page extends Controller {

    function Page()
    {
        parent::Controller();
        
        $this->load->helper('url');
        $this->load->helper('form');
    }
    
    function index()
    {
    

    }
    
    function view()
    {
        $this->load->library('pagination');
           $this->load->model('Blog_model');
           $per_page = 10;
           $total = $this->posts_model->count_posts();
           $data['blogs'] = $this->posts_model->get_posts($per_page, $this->uri->segment(3));

           $base_url = site_url('page/view');
           $config['base_url'] = $base_url;
           $config['total_rows'] = $total;
           $config['per_page'] = $per_page;
           $config['uri_segment'] = '3';

           $this->pagination->initialize($config);
           $this->load->view('page_view', $data);
    
    }
    

}

?>

Model
Code:
<?php

class Blog_model extends Model {

function Blog_model()
{
  parent::Model();
}

function get_posts($limit = NULL, $offset = NULL)
{
  $this->db->limit($limit, $offset);
  return $this->db->get('Blogs');
}

function count_posts()
{
  return $this->db->count_all_results('Blogs');
}

}
?>


View
Code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
&lt;html &gt;
&lt;head&gt;
&lt;meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /&gt;
&lt;title&gt;Untitled Document&lt;/title&gt;
&lt;/head&gt;

&lt;body&gt;
Blog Posts
<br />
&lt;?php
foreach ($blogs->results() as $blog):
echo $blog->Title, '
';
echo $blog->Body_content;
endforeach;

echo $this->pagination->create_links();
?&gt;

&lt;/body&gt;
&lt;/html&gt;

Any help would be greatly appreciated guys, I'm at my wits end.


Messages In This Thread
Pagination problem, getting a blank page. - by El Forum - 09-03-2009, 01:07 PM
Pagination problem, getting a blank page. - by El Forum - 09-03-2009, 01:51 PM
Pagination problem, getting a blank page. - by El Forum - 09-03-2009, 02:39 PM
Pagination problem, getting a blank page. - by El Forum - 09-03-2009, 03:57 PM
Pagination problem, getting a blank page. - by El Forum - 09-04-2009, 01:11 AM
Pagination problem, getting a blank page. - by El Forum - 09-04-2009, 11:03 AM
Pagination problem, getting a blank page. - by El Forum - 09-05-2009, 10:05 PM



Theme © iAndrew 2016 - Forum software by © MyBB