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


PHP Varien_Data_Form::getModel方法代码示例

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


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

示例1: _prepareForm

 /**
  * @return Mage_Adminhtml_Block_Widget_Form
  */
 protected function _prepareForm()
 {
     // form - collection of fieldsets
     $form = new Varien_Data_Form(array('id' => 'mf_general', 'html_id_prefix' => 'mf_general_', 'use_container' => true, 'method' => 'post', 'action' => $this->getUrl('*/*/save', array('_current' => true)), 'field_name_suffix' => 'fields', 'model' => $this->getModel()));
     /** @noinspection PhpUndefinedMethodInspection */
     Mage::helper('mana_core/js')->options('edit-form', array('subforms' => array('#mf_general' => '#mf_general')));
     // fieldset - collection of fields
     /** @noinspection PhpParamsInspection */
     $fieldset = $form->addFieldset('mfs_general', array('title' => $this->__('General Information'), 'legend' => $this->__('General Information')));
     $fieldset->setRenderer($this->getLayout()->getBlockSingleton('mana_admin/crud_card_fieldset'));
     /** @noinspection PhpUndefinedMethodInspection */
     $field = $fieldset->addField('name', 'text', array('label' => $this->__('Name'), 'name' => 'name', 'required' => true, 'default_bit' => Mana_Filters_Resource_Filter2::DM_NAME, 'default_label' => Mage::helper('mana_admin')->isGlobal() ? $this->getModel()->getType() != 'category' ? $this->__('Use Attribute Configuration') : $this->__('Use Default') : ($this->getModel()->getType() != 'category' ? $this->__('Use Attribute Configuration') : $this->__('Use Default'))));
     $field->setRenderer($this->getLayout()->getBlockSingleton('mana_admin/crud_card_field'));
     $field = $fieldset->addField('is_enabled', 'select', array('label' => $this->__('In Category'), 'name' => 'is_enabled', 'required' => true, 'options' => Mage::getSingleton('mana_filters/source_filterable')->getOptionArray(), 'default_bit' => Mana_Filters_Resource_Filter2::DM_IS_ENABLED, 'default_label' => Mage::helper('mana_admin')->isGlobal() ? $this->getModel()->getType() != 'category' ? $this->__('Use Attribute Configuration') : $this->__('Use Default') : $this->__('Same For All Stores')));
     /** @noinspection PhpParamsInspection */
     $field->setRenderer($this->getLayout()->getBlockSingleton('mana_admin/crud_card_field'));
     /** @noinspection PhpUndefinedMethodInspection */
     $field = $fieldset->addField('is_enabled_in_search', 'select', array('label' => $this->__('In Search'), 'name' => 'is_enabled_in_search', 'required' => true, 'options' => Mage::getSingleton('mana_filters/source_filterable')->getOptionArray(), 'default_bit' => Mana_Filters_Resource_Filter2::DM_IS_ENABLED_IN_SEARCH, 'default_label' => Mage::helper('mana_admin')->isGlobal() ? $this->getModel()->getType() != 'category' ? $this->__('Use Attribute Configuration') : $this->__('Use Default') : $this->__('Same For All Stores')));
     $field->setRenderer($this->getLayout()->getBlockSingleton('mana_admin/crud_card_field'));
     // fieldset - collection of fields
     /** @noinspection PhpParamsInspection */
     $fieldset = $form->addFieldset('mfs_display', array('title' => $this->__('Display Settings'), 'legend' => $this->__('Display Settings')));
     $fieldset->setRenderer($this->getLayout()->getBlockSingleton('mana_admin/crud_card_fieldset'));
     $field = $fieldset->addField('display', 'select', array('label' => $this->__('Display'), 'name' => 'display', 'required' => true, 'options' => Mage::getSingleton('mana_filters/source_display_' . $form->getModel()->getType())->getOptionArray(), 'default_bit' => Mana_Filters_Resource_Filter2::DM_DISPLAY, 'default_label' => Mage::helper('mana_admin')->isGlobal() ? $this->__('Use System Configuration') : $this->__('Same For All Stores')));
     /** @noinspection PhpParamsInspection */
     $field->setRenderer($this->getLayout()->getBlockSingleton('mana_admin/crud_card_field'));
     $field = $fieldset->addField('position', 'text', array('label' => $this->__('Position'), 'name' => 'position', 'required' => true, 'default_bit' => Mana_Filters_Resource_Filter2::DM_POSITION, 'default_label' => Mage::helper('mana_admin')->isGlobal() ? $this->getModel()->getType() != 'category' ? $this->__('Use Attribute Configuration') : $this->__('Use Default') : $this->__('Same For All Stores')));
     $field->setRenderer($this->getLayout()->getBlockSingleton('mana_admin/crud_card_field'));
     if ($form->getModel()->getType() == 'attribute') {
         $fieldset->addField('sort_method', 'select', array('label' => $this->__('Sort Items By'), 'name' => 'sort_method', 'options' => Mage::getSingleton('mana_filters/sort')->getOptionArray(), 'required' => true, 'default_bit' => Mana_Filters_Resource_Filter2::DM_SORT_METHOD, 'default_label' => Mage::helper('mana_admin')->isGlobal() ? $this->__('Use System Configuration') : $this->__('Same For All Stores')))->setRenderer($this->getLayout()->getBlockSingleton('mana_admin/crud_card_field'));
         $fieldset->addField('operation', 'select', array_merge(array('label' => $this->__('Combine Multiple Selections Using'), 'name' => 'operation', 'options' => Mage::getSingleton('mana_filters/operation')->getOptionArray(), 'required' => true), Mage::helper('mana_admin')->isGlobal() ? array() : array('default_bit' => Mana_Filters_Resource_Filter2::DM_OPERATION, 'default_label' => $this->__('Same For All Stores'))))->setRenderer($this->getLayout()->getBlockSingleton('mana_admin/crud_card_field'));
     }
     if ($form->getModel()->getType() != 'category') {
         $fieldset->addField('is_reverse', 'select', array_merge(array('label' => $this->__('Reverse Mode'), 'note' => $this->__('If enabled, shows all items as selected and lets user to deselect items he/she is not interested in'), 'name' => 'is_reverse', 'options' => Mage::getSingleton('mana_core/source_yesno')->getOptionArray(), 'required' => true), Mage::helper('mana_admin')->isGlobal() ? array() : array('default_bit' => Mana_Filters_Resource_Filter2::DM_IS_REVERSE, 'default_label' => $this->__('Same For All Stores'))))->setRenderer($this->getLayout()->getBlockSingleton('mana_admin/crud_card_field'));
     }
     $fieldset->addField('disable_no_result_options', 'select', array('label' => $this->__('Filterable (no results) Links Are Not Clickable'), 'name' => 'disable_no_result_options', 'options' => Mage::getSingleton('mana_core/source_yesno')->getOptionArray(), 'required' => true, 'default_bit' => Mana_Filters_Resource_Filter2::DM_DISABLE_NO_RESULT_OPTIONS, 'default_label' => Mage::helper('mana_admin')->isGlobal() ? $this->__('Use System Configuration') : $this->__('Same For All Stores')))->setRenderer($this->getLayout()->getBlockSingleton('mana_admin/crud_card_field'));
     $this->setForm($form);
     return parent::_prepareForm();
 }
开发者ID:xiaoguizhidao,项目名称:cupboardglasspipes.ecomitize.com,代码行数:42,代码来源:General.php


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