Welcome Guest, Not a member yet? Register   Sign In
Problem changing config item in My_Controller
#1

[eluser]spmckee[/eluser]
Greetings,

Im trying to change a config item via my back-end admin settings. In "My_Controller" I have
Code:
$this->output->enable_profiler(Settings::get('my_enable_profiler'));
that doesn't work.


Here's the break-down:
Code:
echo  Settings::get('my_enable_profiler');  //TRUE

// Works
$this->output->enable_profiler(TRUE);

// Doesn't work
$this->output->enable_profiler(Settings::get('my_enable_profiler'));

//Even tried "(boolean)" but didn't work
$this->output->enable_profiler((boolean)Settings::get('my_enable_profiler'));

If my echo gets the same result as typing it i, why doesn't it work?

Thanks,
SP


#2

[eluser]TheFuzzy0ne[/eluser]
Are you absolutely certain it's returning TRUE like you think? Perhaps you should try a var_dump()? The reason I ask, is that's the only reason I can think of why it wouldn't work.

The only other thing I can think of, is that you're calling it too late in your script, but that's quite unlikely. Is this code within your controller constructor?
#3

[eluser]spmckee[/eluser]
Thanks Fuzzy.

Code:
var_dump(Settings::get('my_enable_profiler'));     //string(4) "TRUE"

It lives in
Code:
public function MY_Controller() {

        parent::__construct();

   ....


};
#4

[eluser]TheFuzzy0ne[/eluser]
I'm baffled. I'd suggest copying ./system/core/Output.php to ./application/core/Output.php, (and maybe the same with the profiler) then you can add some debugging code, and hopefully trace the problem back to the source. Sorry, but that's the best I can come up with. I'm totally baffled by this.




Theme © iAndrew 2016 - Forum software by © MyBB