Welcome Guest, Not a member yet? Register   Sign In
Output Profiler always displaying
#1

[eluser]iloveci[/eluser]
Hello,

In my controller constructors I've got $this->output->enable_profiler($var); where $var = a value taken from the db either true or false. The problem is no matter what I put as $var, true, false, 1, 0 it always displays the profiler.

Is this a bug with the profiler output or what? I've tested/double/triple checked that $var is outputting a bool result.
#2

[eluser]danmontgomery[/eluser]
For some reason enable_profiler() explicitly checks for a bool, you may need to typecast the value.

Code:
$this->output->enable_profiler((bool)$var);

Or, you could always just check the value of $var beforehand.

Code:
if($var) {
    $this->output->enable_profiler();
}
#3

[eluser]iloveci[/eluser]
Thanks for the suggestion, I ended up typecasting the value and its working now.




Theme © iAndrew 2016 - Forum software by © MyBB