當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。