Welcome Guest, Not a member yet? Register   Sign In
Dymanic navigation - URL question
#5

[eluser]ZioN[/eluser]
Thank you for your suggestions. I improved the code to:

Code:
public function page(){
//Load models
   $this->load->model('settings_model');
  $this->load->model('pages_model');
// Grab the 3rd url segment - the segment after /page/
  $getPage = $this->uri->segment(3);
  
  $data['settings'] = $this->settings_model->get_settings();
  $data['pages'] = $this->pages_model->get_page($getPage);
  
  $this->load->view('page_view', $data);
  // If page cannot be found, redirect to frontpage.
  if (! $data['pages']){

   redirect('site');
  }  
}


Messages In This Thread
Dymanic navigation - URL question - by El Forum - 09-25-2013, 06:50 AM
Dymanic navigation - URL question - by El Forum - 09-25-2013, 08:22 AM
Dymanic navigation - URL question - by El Forum - 09-25-2013, 11:57 PM
Dymanic navigation - URL question - by El Forum - 09-26-2013, 02:58 AM
Dymanic navigation - URL question - by El Forum - 09-26-2013, 03:17 AM



Theme © iAndrew 2016 - Forum software by © MyBB