Welcome Guest, Not a member yet? Register   Sign In
Load different data depending on URL?
#15

[eluser]tonanbarbarian[/eluser]
try this
Code:
function index($param_1 = FALSE, $param_2 = FALSE, $param_3 = FALSE) {

  $data = array('entities'=>array(), 'title'=>'', 'main'=>'public_page');

  if (empty($param_1) && empty($param_2) && empty($param_3)) {
    $data['title'] = 'no specific category chosen';
  } else {
     $data['title'] = !empty($param_1) ? 'country' : $data['title'];
     $data['title'] = !empty($param_2) ? 'city' : $data['title'];
     $data['title'] = !empty($param_3) ? 'category' : $data['title'];
  }

  $data['entries'] = $this->Mains->get_entries($param_1, $param_2, $param_3);
  $this->load->vars($data);
  $this->load->view('template');
}
If that does not work I think you need to confirm what values you are actually receiving for each of the params
add the following as the first statements for the function
Code:
echo $param_1.'::'.$param_2.'::'.$param_3.'<br />';
because i have a feeling the problem is that there is no controller and method in the url
the url should probably be
http://www.site.com/index.php/[controller]/index/scotland/glasgow/hotels/
[controller] because i do not know what the controller is


Messages In This Thread
Load different data depending on URL? - by El Forum - 10-23-2010, 09:35 AM
Load different data depending on URL? - by El Forum - 10-23-2010, 10:40 AM
Load different data depending on URL? - by El Forum - 10-23-2010, 10:41 AM
Load different data depending on URL? - by El Forum - 10-23-2010, 10:47 AM
Load different data depending on URL? - by El Forum - 10-23-2010, 10:51 AM
Load different data depending on URL? - by El Forum - 10-23-2010, 12:51 PM
Load different data depending on URL? - by El Forum - 10-23-2010, 01:13 PM
Load different data depending on URL? - by El Forum - 10-23-2010, 02:40 PM
Load different data depending on URL? - by El Forum - 10-23-2010, 03:20 PM
Load different data depending on URL? - by El Forum - 10-23-2010, 08:46 PM
Load different data depending on URL? - by El Forum - 10-24-2010, 01:21 AM
Load different data depending on URL? - by El Forum - 10-24-2010, 01:28 AM
Load different data depending on URL? - by El Forum - 10-24-2010, 01:41 AM
Load different data depending on URL? - by El Forum - 10-24-2010, 01:52 AM
Load different data depending on URL? - by El Forum - 10-24-2010, 02:12 AM
Load different data depending on URL? - by El Forum - 10-24-2010, 04:04 AM
Load different data depending on URL? - by El Forum - 10-24-2010, 04:45 AM
Load different data depending on URL? - by El Forum - 10-24-2010, 04:48 AM
Load different data depending on URL? - by El Forum - 10-24-2010, 04:50 AM
Load different data depending on URL? - by El Forum - 10-24-2010, 05:03 AM
Load different data depending on URL? - by El Forum - 10-24-2010, 05:04 AM
Load different data depending on URL? - by El Forum - 10-24-2010, 05:05 AM
Load different data depending on URL? - by El Forum - 10-24-2010, 05:06 AM
Load different data depending on URL? - by El Forum - 10-24-2010, 05:09 AM
Load different data depending on URL? - by El Forum - 10-24-2010, 05:13 AM



Theme © iAndrew 2016 - Forum software by © MyBB