Welcome Guest, Not a member yet? Register   Sign In
Variable variables[solved]
#1

[eluser]codeamatic[/eluser]
does codeigniter support variable variables?

Code:
$$objectName

does codeigniter support global variables such as:

Code:
global $myvar
#2

[eluser]xwero[/eluser]
everything you can do in php you can do in CI
#3

[eluser]TheFuzzy0ne[/eluser]
I should point out though, that I've never found a need to use global variables in a function, so if you are needing to, you might want to rethink your application. The configuration class is ideal, or you can simply place a property in the global scope of the CodeIgniter Super Object, just like how models and libraries are.
#4

[eluser]Vicente Russo[/eluser]
[quote author="TheFuzzy0ne" date="1237408596"]I should point out though, that I've never found a need to use global variables in a function, so if you are needing to, you might want to rethink your application. The configuration class is ideal, or you can simply place a property in the global scope of the CodeIgniter Super Object, just like how models and libraries are.[/quote]

When your code is ultra-automatic, you`ll certainly need variable variables...
#5

[eluser]sophistry[/eluser]
[quote author="Vicente Russo" date="1237446509"]When your code is ultra-automatic, you`ll certainly need variable variables...[/quote]

when you are using variable variables it is a sure sign that you should really come to grips with object oriented programming. resorting to variable variables is fine for a quick fix, but they really are just a poor man's class variable.
#6

[eluser]codeamatic[/eluser]
thank you all for the replies...problem solved...




Theme © iAndrew 2016 - Forum software by © MyBB