CodeIgniter Forums
[SOLVED] View won't load - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20)
+--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23)
+--- Thread: [SOLVED] View won't load (/showthread.php?tid=47582)



[SOLVED] View won't load - El Forum - 12-14-2011

[eluser]Unknown[/eluser]
this controller (below) doesn't work...
it doesn't load the view, whereas all other controllers work like a charm.
all is fine untill the echo 'load template', he echo's what is expected, then he doesn't do anything anymore...
i get to this page after a 3sec delayed auto-redirect on a login succesfull page

Code:
{
function index()
{
  $this->load->model('userModel');
  $logindata = $this->userModel->getUserInfo();
  $pagedata['logindata'] = $logindata;
  
  $tabdata['currenttab'] = 1;
  $tabdata['iscoach'] = $logindata['iscoach'];
  $data['tabdata'] = $tabdata;
  
  if ($this->userModel->is_logged_in())
  { echo 'is logged in';
   $this->load->model('moduleModel');
   $moduledata = $this->moduleModel->generateModulesfor($this->userModel->getUserID());
   $pagedata['moduledata'] = $moduledata;

   $this->load->model('appointmentModel');
   $appointmentdata = $this->appointmentModel->loadAppointments();
   $pagedata['appointmentdata'] = $appointmentdata;
  
   $data['pagedata'] = $pagedata;
   $data['main_content'] = 'coachpage/coachpage';
  }
  else
  {
   $data['main_content'] = 'loginForm';
   $data['pagedata'] = '';
  }
  echo 'load template';
  $this->load->view('includes/template',$data);
}
}
the source code when trying to load the page:
Code:
is logged inload template
whereas the template also has the an echo 'template loaded' statement at the very top.

PS: the echo statements here described are just for debugging purposes...