Welcome Guest, Not a member yet? Register   Sign In
using the paginating class
#4

[eluser]DumpProgrammer[/eluser]
I have put everything in the controller but I cannot the paginating to work here is how my controller is looking like
Code:
function index()
    {
    $data['posts'] = array(); //we will replace soon!
    $data['cats'] = $this->MCats->getTopCategories(); //we will replace soon!
    $data['title'] = "Shout-Africa";
    $data['main'] = 'public_home';
    $data['featured'] = $this->MPosts->getAllFeaturedPosts();
    $data['post'] = $this->MPosts->getAllActivePosts();
    $this->load->vars($data);
    $this->load->view('newheader');
    $this->load->view('newnav');
    $this->load->view('newfeatured');
    
    // set pagination parameters
    $this->load->library('pagination');
    $config['base_url']=base_url();
    $config['total_rows'] = $this->db->count_all('posts');
    $config['per_page'] = '4';
    $config['full_tag_open']='<div class="box">';
    $config['full_tag_close']='</div>';
    $this->pagination->initialize($config);
    // create pagination links
    $data['links']=$this->pagination->create_links();
    // load 'blogger_view' view
    $this->load->view('newcontent',$data);
    $this->load->view('footer');

    }


Messages In This Thread
using the paginating class - by El Forum - 02-06-2010, 10:31 AM
using the paginating class - by El Forum - 02-06-2010, 02:10 PM
using the paginating class - by El Forum - 02-06-2010, 02:28 PM
using the paginating class - by El Forum - 02-07-2010, 07:27 AM



Theme © iAndrew 2016 - Forum software by © MyBB