Welcome Guest, Not a member yet? Register   Sign In
Setting Global Template Variables
#7

[eluser]paradoxic[/eluser]
I am trying to do this as well. I found I can set a variable in config.php like so:
Code:
$config['image_url'] = "http://www.salviasource.org/guamap1/images/";

Then in my view page I can call the variable like so:
Code:
<?= $this->config->item('image_url'); ?>

This works however I am wondering if this is in any way inefficient or if there is a more effective way in doing this. It seems to me that it might be unnecessary to call the config file when there is another place to set global variables that automatically loads with every page.


Messages In This Thread
Setting Global Template Variables - by El Forum - 04-12-2008, 01:45 PM
Setting Global Template Variables - by El Forum - 04-12-2008, 02:19 PM
Setting Global Template Variables - by El Forum - 04-12-2008, 02:24 PM
Setting Global Template Variables - by El Forum - 04-12-2008, 02:30 PM
Setting Global Template Variables - by El Forum - 04-12-2008, 02:38 PM
Setting Global Template Variables - by El Forum - 04-12-2008, 02:42 PM
Setting Global Template Variables - by El Forum - 04-15-2008, 08:28 PM
Setting Global Template Variables - by El Forum - 04-26-2008, 05:23 PM



Theme © iAndrew 2016 - Forum software by © MyBB