當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Varien_Data_Form::addFieldNameSuffix方法代碼示例

本文整理匯總了PHP中Varien_Data_Form::addFieldNameSuffix方法的典型用法代碼示例。如果您正苦於以下問題:PHP Varien_Data_Form::addFieldNameSuffix方法的具體用法?PHP Varien_Data_Form::addFieldNameSuffix怎麽用?PHP Varien_Data_Form::addFieldNameSuffix使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Varien_Data_Form的用法示例。


在下文中一共展示了Varien_Data_Form::addFieldNameSuffix方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: _prepareForm

 /**
  * Prepare form before rendering HTML
  *
  * @return Enterprise_Staging_Block_Manage_Staging_Edit_Tabs_Website
  */
 protected function _prepareForm()
 {
     $form = new Varien_Data_Form();
     $config = Mage::getSingleton('enterprise_staging/staging_config');
     $log = $this->getLog();
     $staging = $log->getStaging();
     $fieldset = $form->addFieldset('general_fieldset', array('legend' => Mage::helper('enterprise_staging')->__('General Information')));
     $fieldset->addField('created_at', 'label', array('label' => Mage::helper('enterprise_staging')->__('Logged At'), 'value' => $this->formatDate($log->getCreatedAt(), 'medium', true)));
     $fieldset->addField('action', 'label', array('label' => Mage::helper('enterprise_staging')->__('Action'), 'value' => Mage::helper('enterprise_staging')->__($config->getActionLabel($log->getAction()))));
     $fieldset->addField('status', 'label', array('label' => Mage::helper('enterprise_staging')->__('Status'), 'value' => Mage::helper('enterprise_staging')->__($config->getStatusLabel($log->getStatus()))));
     $additionalData = $log->getAdditionalData();
     if (!empty($additionalData)) {
         $additionalData = unserialize($additionalData);
         if (is_array($additionalData)) {
             if (isset($additionalData['schedule_date'])) {
                 $fieldset->addField('schedule_date', 'label', array('label' => Mage::helper('enterprise_staging')->__('Schedule Date'), 'value' => Mage::helper('core')->formatDate($additionalData['schedule_date'], Mage_Core_Model_Locale::FORMAT_TYPE_MEDIUM, true)));
             }
             if (isset($additionalData['action_before_reset'])) {
                 $fieldset->addField('action_before_reset', 'label', array('label' => Mage::helper('enterprise_staging')->__('Action Before Resetting'), 'value' => Mage::helper('enterprise_staging')->__($config->getActionLabel($additionalData['action_before_reset']))));
             }
         }
     }
     if ($log->getAction() == Enterprise_Staging_Model_Staging_Config::ACTION_UNSCHEDULE_MERGE) {
         $mergerUrl = $this->getUrl('*/staging_manage/merge', array('id' => $staging->getId()));
         $fieldset->addField('link_to_staging_merge', 'link', array('href' => $mergerUrl, 'label' => Mage::helper('enterprise_staging')->__('Scheduled Merger'), 'value' => $mergerUrl));
     }
     $form->addFieldNameSuffix($this->getFieldNameSuffix());
     $this->setForm($form);
     return parent::_prepareForm();
 }
開發者ID:hyhoocchan,項目名稱:mage-local,代碼行數:35,代碼來源:Form.php

示例2: _prepareForm

 /**
  * prepare the form
  * @access protected
  * @return Mage_Adminhtml_Block_Widget_Form
  */
 protected function _prepareForm()
 {
     $form = new Varien_Data_Form();
     $fieldset = $form->addFieldset(uniqid('fieldset_'), array('legend' => $this->__('Rewrite %s', $this->getIncrement())));
     foreach ($this->getStores() as $store) {
         $fieldset->addField('rewrite_' . $store->getId(), 'text', array('name' => 'store_' . $store->getId(), 'label' => $this->__('Store %s', $store->getName())));
     }
     $fieldset->addField('redirect', 'select', array('name' => 'redirect', 'label' => $this->__('Redirect'), 'options' => array('' => Mage::helper('adminhtml')->__('No'), 'R' => Mage::helper('adminhtml')->__('Temporary (302)'), 'RP' => Mage::helper('adminhtml')->__('Permanent (301)'))));
     $form->setHtmlIdPrefix('rewrite_' . $this->getIncrement() . '_');
     $form->addFieldNameSuffix('rewrite[' . $this->getIncrement() . ']');
     $this->setForm($form);
     return parent::_prepareForm();
 }
開發者ID:ThomasNegeli,項目名稱:CmsRewrites,代碼行數:18,代碼來源:Line.php


注:本文中的Varien_Data_Form::addFieldNameSuffix方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。