当前位置: 首页>>代码示例>>PHP>>正文


PHP Varien_Data_Form::setData方法代码示例

本文整理汇总了PHP中Varien_Data_Form::setData方法的典型用法代码示例。如果您正苦于以下问题:PHP Varien_Data_Form::setData方法的具体用法?PHP Varien_Data_Form::setData怎么用?PHP Varien_Data_Form::setData使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Varien_Data_Form的用法示例。


在下文中一共展示了Varien_Data_Form::setData方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: _prepareForm

 /**
  * @return Mage_Adminhtml_Block_Widget_Form
  */
 protected function _prepareForm()
 {
     $form = new Varien_Data_Form(array('id' => 'edit_form', 'action' => $this->getUrl('*/*/save'), 'method' => 'post', 'enctype' => 'multipart/form-data'));
     $form->setData('use_container', true);
     $this->setForm($form);
     return parent::_prepareForm();
 }
开发者ID:shakhawat4g,项目名称:Magento-Gallery-Extension,代码行数:10,代码来源:Form.php

示例2: createForm

 /**
  * @return Varien_Data_Form
  */
 private function createForm()
 {
     /** @var Varien_Data_Form $result */
     $result = new Varien_Data_Form();
     $result->setData('html_id_prefix', 'rule_');
     $this->createFieldset($result);
     df_assert($result instanceof Varien_Data_Form);
     return $result;
 }
开发者ID:xiaoguizhidao,项目名称:ortodon,代码行数:12,代码来源:Conditions.php

示例3: _prepareForm

 protected function _prepareForm()
 {
     $form = new Varien_Data_Form(array('id' => 'edit_form', 'action' => $this->getData('action'), 'method' => 'post'));
     $form->setData('use_container', true);
     $this->setForm($form);
     $this->_addBaseFieldset();
     $form->setValues($this->_getReport()->getData());
     return parent::_prepareForm();
 }
开发者ID:sreichel,项目名称:custom-reports,代码行数:9,代码来源:Form.php

示例4: _prepareForm

 protected function _prepareForm()
 {
     //$form = new Varien_Data_Form(array("encrypt","multipart/form-data"));
     $form = new Varien_Data_Form(array('id' => 'addgiftvoucher', 'action' => $this->getData('action'), 'method' => 'post', 'enctype' => 'multipart/form-data'));
     $form->setData('enctype', 'multipart/form-data');
     $form->setData('id', 'addgiftvoucher');
     $this->setForm($form);
     $fieldset = $form->addFieldset('customer', array('legend' => Mage::helper('giftcert')->__('Customer')));
     $fieldset->addField('customer_name', 'text', array('label' => Mage::helper('giftcert')->__('Customer name'), 'name' => 'customer_name'));
     $fieldset->addField('customer_email', 'text', array('label' => Mage::helper('giftcert')->__('Customer email'), 'name' => 'customer_email'));
     $fieldset_recipient = $form->addFieldset('recipient', array('legend' => Mage::helper('giftcert')->__('Recipient')));
     $fieldset_recipient->addField('recipient_name', 'text', array('label' => Mage::helper('giftcert')->__('Recipient name'), 'name' => 'recipient_name'));
     $fieldset_recipient->addField('recipient_email', 'text', array('label' => Mage::helper('giftcert')->__('Recipient email'), 'name' => 'recipient_email'));
     $fieldset_recipient->addField('recipient_address', 'textarea', array('label' => Mage::helper('giftcert')->__('Recipient Address'), 'name' => 'recipient_address'));
     $fieldsetmess = $form->addFieldset('message_set', array('legend' => Mage::helper('giftcert')->__('Message')));
     $fieldsetmess->addField('message', 'textarea', array('label' => Mage::helper('giftcert')->__('Message'), 'name' => 'message'));
     if (Mage::getSingleton('adminhtml/session')->getgiftcertData()) {
         $form->setValues(Mage::getSingleton('adminhtml/session')->getgiftcertData());
         Mage::getSingleton('adminhtml/session')->setgiftcertData(null);
     } elseif (Mage::registry('giftcert_data')) {
         $form->setValues(Mage::registry('giftcert_data')->getData());
     }
     return parent::_prepareForm();
 }
开发者ID:Farik2605,项目名称:tobi,代码行数:24,代码来源:Message.php

示例5: init

 /**
  * @param Varien_Data_Form $form
  * @param RK_TypeCMS_Model_Page $page
  */
 public function init(Varien_Data_Form $form, RK_TypeCMS_Model_Page $page)
 {
     $attributes = $this->getAttributes();
     if (!count($attributes)) {
         return;
     }
     $fieldset = $form->addFieldset('typecms_fields', array('legend' => Mage::helper('typecms')->__('TypeCMS Fields'), 'class' => 'fieldset-wide'));
     foreach ($attributes as $code => $attribute) {
         $type = Mage::helper('typecms')->attributeTypeToFieldType($attribute['type']);
         $label = Mage::helper('typecms')->__($attribute['label']);
         if ($type == 'file') {
             $field = $fieldset->addField('typecms_' . $code, 'file', array('name' => 'typecms[' . $code . ']', 'label' => $label, 'after_element_html' => '<script type="text/javascript">setTimeout(function(){$(\'edit_form\').enctype = \'multipart/form-data\';}, 50);</script>'));
             if ($page->getData($code)) {
                 if ($attribute['type'] == 'image') {
                     $field->setData('after_element_html', '<br />
                     <img src="' . Mage::helper('typecms')->getBaseImageUrl() . $page->getData($code) . '" width="300" /><br />
                     <label><input type="checkbox" name="typecms[' . $code . '_delete]" value="1" /> Delete image</label>' . $field->getData('after_element_html'));
                 } else {
                     $field->setData('after_element_html', '<br />
                     ' . Mage::helper('typecms')->escapeHtml($page->getData($code)) . '<br />
                     <label><input type="checkbox" name="typecms[' . $code . '_delete]" value="1" /> Delete file</label>' . $field->getData('after_element_html'));
                 }
             }
             $form->setData('enctype', 'multipart/form-data');
         } else {
             $field = $fieldset->addField('typecms_' . $code, $type, array('name' => 'typecms[' . $code . ']', 'label' => $label));
         }
         if ($attribute['type'] == 'yesno') {
             $attribute['options'] = array(0 => 'No', 1 => 'Yes');
         }
         if ($type == 'editor') {
             $wysiwygConfig = Mage::getSingleton('cms/wysiwyg_config')->getConfig(array('tab_id' => 'main'));
             $field->addData(array('style' => 'height:36em;', 'config' => $wysiwygConfig));
         } elseif ($type == 'select') {
             $field->addData(array('values' => $attribute['options']));
         }
     }
 }
开发者ID:adamj88,项目名称:RK_TypeCMS,代码行数:42,代码来源:Default.php


注:本文中的Varien_Data_Form::setData方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。