Welcome Guest, Not a member yet? Register   Sign In
Class -> View variables
#1

[eluser]rockstyle[/eluser]
Is this trick right?
Quote:$vars[$var] = $bank[$var];
I use it when i want my variables from inside a class to be used inside of a views. But CI Debug shows me that $var in this case is undeclared? How can i do this if i have many variables and don't want to write them down?
#2

[eluser]maria clara[/eluser]
[quote author="rockstyle" date="1265494588"]Is this trick right?
Quote:$vars[$var] = $bank[$var];
I use it when i want my variables from inside a class to be used inside of a views. But CI Debug shows me that $var in this case is undeclared? How can i do this if i have many variables and don't want to write them down?[/quote]

your variable $var is not declared. try something like this. if im not mistaken it is an array.

Code:
$var = array();  // put this to declare your variable

$vars[$var] = $bank[$var];


hope that helps.

regards,
kahtrina Wink




Theme © iAndrew 2016 - Forum software by © MyBB