Passing data to a form

1 message Options
Embed this post
Permalink
-cab

Passing data to a form

Reply Threaded More More options
Print post
Permalink
Hello,

i have a website which has to show many different forms with very little differences, so i want to try to manage all the forms with a single php file.

Basically, what i need to do is this:

1) In indexcontroller i determine the type of data that the user requested
2) I pass the data type to the form model
3) In the form model, with an instruction like

if($type = $variablePassedToTheForm)
   ... do something ...

i select the fields to be added to the view.

Is this possible?

Thanks!