Welcome Guest, Not a member yet? Register   Sign In
Enable profiler
#1

[eluser]ninjayan[/eluser]
Hi everyone! So its me again.

I have this code in my controller
Code:
public function __construct() {
  parent::__construct();
  $this->output->enable_profiler(TRUE);
  $this->clear_cache();

  if ($this->session->userdata('is_logged_in') && ($this->session->userdata('is_logged_in') == 1)) {
   redirect('site/dashboard');
  }
}
When I try to login, nothing works but if I remove
Code:
$this->output->enable_profiler(TRUE);
It works fine. How can I fix that? What is the problem?
#2

[eluser]Aken[/eluser]
You'll need to be more specific about "nothing works".
#3

[eluser]ninjayan[/eluser]
Sorry.
If I click the login (function at the same controller) nothing happens.
#4

[eluser]CroNiX[/eluser]
Are you using ajax? If you use ajax with the profiler running it will append all of the profiler data/html to the end of the ajax request (actually, any request), ruining anything returned.

If this is your case, I usually do:
Code:
if ( ! $this->input->is_ajax_request())
{
  $this->output->enable_profiler(TRUE);
}
#5

[eluser]ninjayan[/eluser]
Yes I'm using ajax. Will try your input. Thanks!




Theme © iAndrew 2016 - Forum software by © MyBB