Akhil N K
Akhil N K

Reputation: 13

Set the value of textbox in a zend form from a controller and display the form

I have a Zend form where there are lot of textboxes. I need to set the value of these textboxes from the respective controller and present the form while performing an action. How can I acheive the same?

Upvotes: 1

Views: 3332

Answers (1)

Andrej
Andrej

Reputation: 7504

Try to use like this one:

$form = new Zend_From();
$textfield = new Zend_Form_Element_Text('textfield');
$textfield->setValue('your value');
$form->addElement($textfield);

<?= $form ?>

Upvotes: 1

Related Questions