Welcome Guest, Not a member yet? Register   Sign In
passing config array
#1

[eluser]bhbutter123[/eluser]
Just a quick question, hopefully. How would I pass the config array that is set in config.php to a view? Also, would config.php allow if statements, for example i have set a key for the server path and it is different on the live server than the development server so i am using an if statement to act on the server name and make the path accordingly.
#2

[eluser]Colin Williams[/eluser]
Quote:How would I pass the config array

Why pass it and not use config_item('item') function? If you must, do

Code:
$this->load->vars('config', $this->config->config)

Quote:Also, would config.php allow if statements

Of course. It's still PHP and CI has changed nothing about PHP
#3

[eluser]wiredesignz[/eluser]
Keep in mind that $this->load->vars() is much faster than repeated use of config_item()




Theme © iAndrew 2016 - Forum software by © MyBB