Welcome Guest, Not a member yet? Register   Sign In
base_url not passsing the values
#1

[eluser]mady[/eluser]
Hi,


I have a function where i want to pass the values for searching and pagination, but its not working



This is my code



Code:
$this->load->library('pagination');
  $config = array();
  $config["base_url"] = site_url('movies/movies_view/$query_id/$sort_by/$sort_order');
  
  var_dump($config["base_url"]);
  
  
  $config['total_rows'] = $data['num_results'];
  $config['per_page'] = $limit;
  $config['uri_segment'] = 6;
  $config['enable_query_strings'] = TRUE;
  $this->pagination->initialize($config);
  $data['pagination'] = $this->pagination->create_links();
#2

[eluser]csotelo[/eluser]
try
Code:
$config["base_url"] = site_url("movies/movies_view/$query_id/$sort_by/$sort_order"); //double quotes

or
Code:
$config["base_url"] = site_url("movies/movies_view/").$query_id."/".$sort_by."/".$sort_order;
#3

[eluser]mady[/eluser]
oh no, completely mess up!


thank you dude.


#4

[eluser]solid9[/eluser]
Everything can be done in the method/function alone

function searching_test('$keyword, $query_id, $sort_by, $sort_order) {
//capture data here...
//codes to configure the pagination here...
//codes to call the model etc...
//codes here, etc.. etc... etc...
//codes to display your view here...
}

Hope you get the idea.






Theme © iAndrew 2016 - Forum software by © MyBB