Welcome Guest, Not a member yet? Register   Sign In
initialize variables
#3

[eluser]Colin Williams[/eluser]
I typically use a very generic Variable library which works like config_item with the addition of the "default if not existent" argument.

Code:
function get_variable(string $variable_key, mixed $default_value)

jedd, the values are in a 'variable' table in the database, and the "defaults" are essentially provided right there in the function call. Like the OP mentioned, the purpose is to avoid unnecessary IF/ELSE blocks everywhere.


Messages In This Thread
initialize variables - by El Forum - 10-13-2009, 02:33 PM
initialize variables - by El Forum - 10-13-2009, 06:05 PM
initialize variables - by El Forum - 10-13-2009, 06:45 PM
initialize variables - by El Forum - 10-13-2009, 07:03 PM
initialize variables - by El Forum - 10-14-2009, 09:15 AM
initialize variables - by El Forum - 10-14-2009, 10:24 AM



Theme © iAndrew 2016 - Forum software by © MyBB