本文整理汇总了PHP中Varien_Data_Form::getHtml方法的典型用法代码示例。如果您正苦于以下问题:PHP Varien_Data_Form::getHtml方法的具体用法?PHP Varien_Data_Form::getHtml怎么用?PHP Varien_Data_Form::getHtml使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Varien_Data_Form
的用法示例。
在下文中一共展示了Varien_Data_Form::getHtml方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: _toHtml
protected function _toHtml()
{
$_form = new Varien_Data_Form();
$_form->setElementRenderer($this->getLayout()->createBlock('adminhtml/widget_form_renderer_element'));
$_form->setFieldsetRenderer($this->getLayout()->createBlock('adminhtml/widget_form_renderer_fieldset'));
$_form->setFieldsetElementRenderer($this->getLayout()->createBlock('adminhtml/widget_form_renderer_fieldset_element'));
$_fieldset = $_form->addFieldset('types_data_fset', array('legend' => $this->__('Representation settings')));
$_fieldset->setFieldsetContainerId('awf_types_settings');
$type = Mage::getSingleton('awfeatured/representations_config')->getRepresentation($this->getData('type'));
foreach ($type->getOptions() as $key => $options) {
$_field = $_fieldset->addField($key, $options['input_type'], array('label' => $this->__($options['label']), 'name' => 'type_data[' . $key . ']'));
if ($_field) {
if (isset($options['default'])) {
$_field->setValue($options['default']);
}
if ($options['input_type'] == 'select' && isset($options['source_model'])) {
$_field->setValues(Mage::getModel($options['source_model'])->toOptionArray());
}
if (isset($options['required'])) {
$_field->setRequired($options['required']);
}
}
}
if ($this->getData('is_init')) {
$_data = Mage::getSingleton('adminhtml/session')->getData(AW_Featured_Helper_Data::FORM_DATA_KEY);
$_data = isset($_data['type_data']) ? $_data['type_data'] : null;
if ($_data) {
$_form->setValues($_data);
}
}
return $_form->getHtml();
}