[英]Set default value of an element in Zend_Form by reference from the controller
[英]Set the value of textbox in a zend form from a controller and display the form
我有一個Zend表單,其中有很多文本框。 我需要從相應的控制器設置這些文本框的值,並在執行操作時顯示表單。 我怎樣才能達到相同的效果?
嘗試像這樣使用:
$form = new Zend_From();
$textfield = new Zend_Form_Element_Text('textfield');
$textfield->setValue('your value');
$form->addElement($textfield);
<?= $form ?>
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.