本文整理匯總了PHP中Varien_Data_Form::setPost方法的典型用法代碼示例。如果您正苦於以下問題:PHP Varien_Data_Form::setPost方法的具體用法?PHP Varien_Data_Form::setPost怎麽用?PHP Varien_Data_Form::setPost使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Varien_Data_Form
的用法示例。
在下文中一共展示了Varien_Data_Form::setPost方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: _prepareForm
protected function _prepareForm()
{
$form = new Varien_Data_Form();
$installment = Mage::registry('current_installment_payment');
$fieldset = $form->addFieldset('base_fieldset', array('legend' => Mage::helper('installment')->__('Installment Payment')));
$fieldset->addField('order_id', 'text', array('name' => 'order_id', 'label' => Mage::helper('installment')->__('Order Id'), 'title' => Mage::helper('installment')->__('Order Id'), 'readonly' => true));
$fieldset->addField('installment_master_amount_due', 'text', array('name' => 'amount_due', 'label' => Mage::helper('installment')->__('Amount Due'), 'title' => Mage::helper('installment')->__('Amount Due'), 'required' => true));
if (!is_null($installment->getId())) {
// If edit add id
$form->addField('id', 'hidden', array('name' => 'id', 'value' => $installment->getId()));
}
$data = Mage::getSingleton('adminhtml/session')->getInstallmentPaymentData();
if (Mage::getSingleton('adminhtml/session')->getInstallmentPaymentData()) {
$form->addValues(Mage::getSingleton('adminhtml/session')->getInstallmentPaymentData());
Mage::getSingleton('adminhtml/session')->setInstallmentPaymentData(null);
} else {
$form->addValues($installment->getData());
}
$form->setUseContainer(true);
$form->setId('edit_form');
$form->setAction($this->getUrl('*/*/adjust'));
$form->setPost(true);
$this->setForm($form);
return parent::_prepareForm();
}