include set of custom variables and array - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20) +--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23) +--- Thread: include set of custom variables and array (/showthread.php?tid=11129) |
include set of custom variables and array - El Forum - 08-27-2008 [eluser]LuckyFella73[/eluser] Hello, I want to set up file containing variables and arrays for example: Code: $clearGIF = '<img src="clear.gif" width="1" height="1" border ="0" alt="">' In older versions of CI there was a script-folder and I loaded my "conf-file" this way: Code: $this->load->script('formfields_'.get_class($this)); 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 include set of custom variables and array - El Forum - 08-27-2008 [eluser]LuckyFella73[/eluser] Just found in the userguide that it's possible to load this kind of files like: Code: $this->load->file('system/application/config/own_config.php', true); my conf file now looks like: Code: $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: Code: <?php echo($this->clearGIF); ?> Just in case someone else has the same question ... |