Welcome Guest, Not a member yet? Register   Sign In
base_url question?
#1

[eluser]anna16[/eluser]
Hello guys

I'm studying pagination.

I don't know how to put my __construct() function as my base_url

This is what i did below,
Code:
$config['base_url'] = 'http://www.mysite.org/ci/userauth.php/site/__construct/';

Please correct me if i am wrong.
Sorry i have no index, my index method is the __construct() function,
Code:
class Site extends Controller
{
    function __construct()
    {
        parent::Controller();
      $this->is_logged_in();

    //////////////////////////////
    //  Display Total Donation  //
    //////////////////////////////
    //duke
    $this->load->model('membership_model','',TRUE);    
        if($query = $this->membership_model->get_duke())
        {
            $data['records_duke'] = $query;
        }
    
    //uf
    $this->load->model('membership_model','',TRUE);    
        if($query = $this->membership_model->get_uf())
        {
            $data['records_uf'] = $query;
        }

    //knipe
    $this->load->model('membership_model','',TRUE);    
        if($query = $this->membership_model->get_knipe())
        {
            $data['records_knipe'] = $query;
        }
    
    $this->load->view('meter', $data);
    // End of Total Donation Display
    
    //////////////////////////////
    //    Display Pagination    //
    //////////////////////////////
    $this->load->library('pagination');
    
    $config['base_url'] = 'http://www.mysite.org/ci/userauth.php/site/';
    $config['total_rows'] = $this->db->get('organization')->num_rows();
    $config['per_page'] = 5;
    $config['num_links'] = 20;
    
    $this->pagination->initialize($config);
    $data_pagination['records'] = $this->db->get('organization', $config['per_page'], $this->uri->segment(3));
    $this->load->view('meter', $data_pagination);
    
    #echo $this->pagination->create_links();
     }

Thanks in advanced.
#2

[eluser]anna16[/eluser]
I'm also having problem every time i use this code below on my view page,
Code:
echo $this->pagination->create_links();

the error message is,
Code:
Fatal error: Call to a member function create_links() on a non-object in /home/herpescu/public_html/ci/application/userauth/views/meter.php on line 197

Please note I'm also using the same controller codes above.
#3

[eluser]anna16[/eluser]
problem solved.

no need to reply.




Theme © iAndrew 2016 - Forum software by © MyBB