Welcome Guest, Not a member yet? Register   Sign In
Problem with pagination class
#1

[eluser]Unknown[/eluser]
tried doing this on my own but had no luck =/ My pagination is on the main page, I have some sort of blog system there, the only other view on that controller is login, which after enabling the pagination just disappeared and now instead of URL/login it displays the main page.

My controller:
Code:
public function view($page = 'index')
    {
        if ( !file_exists('application/views/pages/'.$page.'.php') || $page == 'header' || $page == 'footer')
        {
            // Whoops, we don't have a page for that!
            show_404();
        }
        if( $page = 'index' ) {
            $this->load->library('pagination');
            $config['base_url'] = base_url('posts');
            $config['total_rows'] = $this->db->order_by("id", "desc")->get('Updates')->num_rows();
            $config['per_page'] = 5;
            $config['uri_segment'] = 3;
            $config['full_tag_open'] = '<div id="pages">';
            $config['full_tag_close'] = '</div>';
            $this->pagination->initialize($config);
            $data['records'] = $this->db->order_by("id", "desc")->get('Updates', $config['per_page'], $this->uri->segment(2));
        }
        $this->load->model('panel_model');
        $data['math_captcha_question'] = $this->mathcaptcha->get_question();
        $this->load->view('header');
        $this->load->view('pages/'.$page, $data);
        $this->load->view('footer');
    }
routes.php:

Code:
$route['login'] = "pages/view/login";

I'd be really glad if any of you guys could give me a hand Smile

Thanks in advance!

P.S
Sorry I might look like a parasite, just registered and already asking for help, I'm just really stuck, no help on stackoverflow either =/




Theme © iAndrew 2016 - Forum software by © MyBB