Welcome Guest, Not a member yet? Register   Sign In
include set of custom variables and array


I want to set up file containing variables and arrays for example:
$clearGIF = '<img src="clear.gif" width="1" height="1" border ="0" alt="">'
which should be available in the view files.

In older versions of CI there was a script-folder and I loaded my "conf-file"
this way:

What is the best way to do this with CI 1.6.3 ? I didn't find a thread
about this (maybe it's because my english is not the best and I can't
figure out the right search term to find the right thread ...)

The own conf files don't have to be autoloaded, because I need different
ones in different controllers/ views

Just found in the userguide that it's possible to load this kind of files like:
$this->load->file('system/application/config/own_config.php', true);

my conf file now looks like:
$this->clearGIF  = '<img src="'.base_url().'clear.gif" width="1" height="1" border ="0" alt="">';

and in the view I can acess the vars like:
&lt;?php echo($this->clearGIF); ?&gt;

Just in case someone else has the same question ...

Theme © iAndrew 2016 - Forum software by © MyBB