致命错误:调用成员函数initialize()

I've controller like this

function view()
    {
        if($this->tank_auth->get_user_role_id() == 1){
            $users = null;
        }else{
            $users = $this->_get_users_id();
        }
        //count total rows of transaction list
        $this->db->where('user_id',$users);
        $this->db->from('book_packages');
        $config['base_url'] = base_url().'index.php/transaction/view';
        $config['total_rows'] = $this->db->count_all_results();
        $config['per_page'] = 10;
        $config['uri_segment'] = 3;
        $config['num_links'] = 1;

        /* this is config tag */

        $this->pagination->initialize($config);
        $data['total_rows'] = $config['total_rows'] ;
        $data['title'] = 'List transaction';
        $data['text'] = $this->transaction_model->view_transaction($config['per_page'],$this->uri->segment(3),$users);
        $data['pagecontent'] = "admin/view_transaction";
        $this->load->vars($data);
        $this->load->view('template');

    }

I echo this in the view $this->pagination->create_links(); when I load the controller I got error like this

A PHP Error was encountered

Severity: Notice

Message: Undefined property: Transaction::$pagination

Filename: controllers/transaction.php

Line Number: 804

Fatal error: Call to a member function initialize() on a non-object in my directory

I don't know why, I already load the library pagination, helper url, the name of class with capital. and it's happen when I upload my code to hosting, but I not get any error when I load it in localhost.

any help are really appreciated. Thank you very much.

function view()
    {
        if($this->tank_auth->get_user_role_id() == 1){
            $users = null;
        }else{
            $users = $this->_get_users_id();
        }
        //count total rows of transaction list
        $this->db->where('user_id',$users);
        $this->db->from('book_packages');
        $config['base_url'] = base_url().'index.php/transaction/view';
        $config['total_rows'] = $this->db->count_all_results();
        $config['per_page'] = 10;
        $config['uri_segment'] = 3;
        $config['num_links'] = 1;

        /* this is config tag */


        /*THIS IS MISSING*/
        $this->load->library('pagination');




        $this->pagination->initialize($config);
        $data['total_rows'] = $config['total_rows'] ;
        $data['title'] = 'List transaction';
        $data['text'] = $this->transaction_model->view_transaction($config['per_page'],$this->uri->segment(3),$users);
        $data['pagecontent'] = "admin/view_transaction";
        $this->load->vars($data);
        $this->load->view('template');

    }

The error message is saying that $this->pagination isn't defined. Where did you define (say) that $this->pagination = new Pagination()? Obviously, new Pagination would have to be replaced by the name of your pagination library.

Try putting your autoload script on _construct() at the beginning of the controller.

it must be something like this:

public function __construct() {

      parent:: __construct();
      $this->load->library("pagination");

}

then on your method, try initializing your $config first:

$config = array();

$config['base_url'] = base_url().'index.php/transaction/view';

$config['total_rows'] = $this->db->count_all_results();

$config['per_page'] = 10;

$config['uri_segment'] = 3;

$config['num_links'] = 1;

Or kindly check again your autoload file under config/autoload.php if you really included 'pagination' on $autoload['libraries']