[horde] Form & Variable Classes

mbydalek at mobilemini.com mbydalek at mobilemini.com
Wed Nov 17 13:52:40 PST 2004


All:

Just a quick general question regarding these 2 classes as I have been
pulling my hair out trying to figure out what's going (or more likely, what
I'm doing wrong).

Basically I'm creating a custom form, and am using Whups' ticket/create.php
and lib/Create.php as templates.  What's getting me though are the variables
that are hidden via the addHidden() function and referencing that
information in a later form.

For example, in Step1 of the lib/Create.php equivalent say, I have a line
that says:
$branch = &$this->addHidden('branch', 'branch', 'text', false);
$branch->setDefault(100);

Well, in Step2, if I do a $vars->get('branch') - nothing is returned.  If I
make 'branch' not hidden, and just do a regulary addVariable(), the get()
works just fine.

So, is there something special that needs to be done to call hidden
variables?  The code I've tried to validate this was the following:
$variables = $form2->getVariables(true, true);

foreach ($variables as $var) {
    echo $var->getHumanName() . ": " . $vars->get($var->getVarName()) .
"<br>";
}

All that would output would be all my normal variables, but then just a
"branch: " for the hidden one, so I know it's there, just where's the data?

Thanks in advance for helping clarify this for me.

-Mike



More information about the horde mailing list