Welcome Guest, Not a member yet? Register   Sign In
User agent code for entire application
#4

[eluser]tonanbarbarian[/eluser]
It does matter to a certain degree where you put it
in a controller or model
Code:
$this->config->set_item('my_item', $value);
...
$this->config->item('my_item');
In a library, or if you must, a view
Code:
$CI =& get_instance();
$CI->config->set_item('my_item', $value);
...
$CI->config->item('my_item');
Just be careful, if you are extending some of the core CI libraries, like Input, Router, Benchmark etc they may be instantiated before the controller is created in which case neither of the 2 methods above will work


Messages In This Thread
User agent code for entire application - by El Forum - 01-08-2008, 04:17 PM
User agent code for entire application - by El Forum - 01-08-2008, 04:33 PM
User agent code for entire application - by El Forum - 01-08-2008, 04:40 PM
User agent code for entire application - by El Forum - 01-08-2008, 04:49 PM
User agent code for entire application - by El Forum - 01-08-2008, 04:56 PM



Theme © iAndrew 2016 - Forum software by © MyBB