user789122
user789122

Reputation: 480

Passing values to forms

I have a form, that I'd like to display a select list, where the user can select an item and save.

What I need to do though, is pass a value to the form:

$form = new TestForm($id)

How do I then get the value of $id in my Testform class?

Upvotes: 0

Views: 57

Answers (1)

user789122
user789122

Reputation: 480

The following seemed to work:

$id = $this->getOption('id'); 

and

TestForm(array(),array('id'=>$id))

Upvotes: 2

Related Questions