Welcome Guest, Not a member yet? Register   Sign In
SOLVED: How to set config value at startup using a function, including database query
#1

[eluser]Genki1[/eluser]
Hi folks,

How to set config values on startup using a function? I want to use the result of a function to initialize values that will be available throughout the application.

I tried this in config/config.php:
Code:
$config['my_variable'] = my_function();
. Result: "Call to undefined function my_function()"

I also tried using the CI feature $ASSIGN_TO_CONFIG (as described in index.php, CI v2.0.2):
Code:
$assign_to_config['my_variable'] = my_function();
. Result: "Call to undefined function my_function() in index.php"

I know that the function exists and functions properly because I use it in my controllers and models.

Any suggestions?


Messages In This Thread
SOLVED: How to set config value at startup using a function, including database query - by El Forum - 01-31-2012, 04:07 PM



Theme © iAndrew 2016 - Forum software by © MyBB