[eluser]Mackstar[/eluser]
I have a custom helper that I want to use in my views
It contains a function that dynamically manipulates values added to the form. Because I want it to use dynamic variables, but using global doesn't seem to work. Even if I hard code my variables
This is what I am doing
Code:
function form_values($variable, $head=NULL)
{
if($head)
global ${$head};
if(isset(${$head}[$variable]))
return ${$variable};
elseif($head)
return set_value("{$head}[{$variable}]");
else
return set_value($variable);
}
I have a array set into
$account and am calling it as in
Code:
<input type="text" name="account[name]" value="<?php echo form_values("name", "account"); ?>" size="50" />
I have complete access to the
$account array in the view.
Why is this not registering the array as a global?
Thanks in advance
Richard