Welcome Guest, Not a member yet? Register   Sign In
wondering about pagination!
#1

[eluser]husni[/eluser]
this is a part of my codes in the controller while doing pagination..
Code:
$data['querys'] = $this->helpdesk_model->display_menu();
$config['base_url']='http://localhost/helpdesk/index.php/site/list_of_user/';
$config['total_rows']=$this->helpdesk_model->getNumReport();
$config['per_page']='3';
$this->pagination->initialize($config);
$data['reports']=$this->helpdesk_model->getReport($row);
        
$data['title']='Displaying List Of user';
        
$data['header']='User List';
        
$data['links']=$this->pagination->create_links();
        
$this->load->view('list_of_user', $data);

i wonder about the base_url.. the config file has contained the $config['base_url']..
so when it comes to this..the variable of base_url will be changed isnt it..
in addition,i have set the $config['base_url'] in config file to 'http://localhost/helpdesk/index.php/'; ..
wondering about this..anyone can help or explain to me??
#2

[eluser]chonlatee[/eluser]
sorry my english.

i understand base_url in config file is base_url your site but base_url in pagination is base_url for pagination

Code:
function list_data_one()
   {
      $config['base_url'] = 'http://localhost/helpdesk/index.php/site/list_data_one/'
   }
   function list_data_two()
   {
     $config['base_url'] = 'http://localhost/helpdesk/index.php/site/list_data_two/'
   }

i hope it help you.
#3

[eluser]husni[/eluser]
[quote author="chonlatee" date="1269507988"]sorry my english.

i understand base_url in config file is base_url your site but base_url in pagination is base_url for pagination

Code:
function list_data_one()
   {
      $config['base_url'] = 'http://localhost/helpdesk/index.php/site/list_data_one/'
   }
   function list_data_two()
   {
     $config['base_url'] = 'http://localhost/helpdesk/index.php/site/list_data_two/'
   }

i hope it help you.[/quote]


it means it is not the same??
#4

[eluser]chonlatee[/eluser]
i think it's not the same
#5

[eluser]husni[/eluser]
[quote author="chonlatee" date="1269516744"]i think it's not the same[/quote]

ok thnx! anyone who have any explainations or suggestion can also post something as reference to all people.. =)
#6

[eluser]Ivar89[/eluser]
If you have set the Base_url in the config file, then;
Code:
$config['base_url'] = base_url() . 'site/list_data_one/';
that should work, I had same problem
#7

[eluser]husni[/eluser]
[quote author="Ivar89" date="1269522171"]If you have set the Base_url in the config file, then;
Code:
$config['base_url'] = base_url() . 'site/list_data_one/';
that should work, I had same problem[/quote]

thnx..i have tried that one and it works..
now i am using this code and it is also works..
Code:
$config['base_url'] = current_url();
#8

[eluser]Ivar89[/eluser]
Glad to help ^^




Theme © iAndrew 2016 - Forum software by © MyBB