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


PHP Mage_Eav_Model_Entity_Attribute::getFrontend方法代码示例

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


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

示例1: _getEditableAttributeBaseConfig

 /**
  * Return the base config for given editable attribute
  * 
  * @param string $type Grid block type
  * @param string $code Attribute code
  * @param Mage_Eav_Model_Entity_Attribute $attribute Attribute object
  * @return array
  */
 protected function _getEditableAttributeBaseConfig($type, $code, $attribute)
 {
     // All those values pretty much correspond to the editable fields configs ones ("missing" ones are induced)
     return array('in_grid' => in_array($attribute->getFrontend()->getInputType(), array('date', 'multiselect', 'price', 'select', 'text')), 'edit_block_type' => 'default', 'render_block_type' => 'default', 'ids_key' => 'identifiers', 'additional_key' => 'additional', 'values_key' => 'values', 'must_filter' => false, 'filter_type' => null, 'filter_params' => array(), 'render_reload' => $attribute->getBackendModel() != '', 'column_params' => array(), 'layout_handles' => array(), 'window_width' => '80%', 'window_height' => '80%', 'window_draggable' => true, 'window_resizable' => true, 'window_recenter_auto' => false, 'window_title' => Mage::helper('customgrid')->__('Edit Value'), 'renderer_params' => array());
 }
开发者ID:becchius,项目名称:fiordivaniglia,代码行数:13,代码来源:Abstract.php

示例2: _addSearchCriteria

 /**
  * Add data about search criteria to object state
  *
  * @param   Mage_Eav_Model_Entity_Attribute $attribute
  * @param   mixed $value
  * @return  Mage_CatalogSearch_Model_Advanced
  */
 protected function _addSearchCriteria($attribute, $value)
 {
     $name = $attribute->getFrontend()->getLabel();
     if (is_array($value) && (isset($value['from']) || isset($value['to']))) {
         if (isset($value['currency'])) {
             $currencyModel = AO::getModel('directory/currency')->load($value['currency']);
             $from = $currencyModel->format($value['from'], array(), false);
             $to = $currencyModel->format($value['to'], array(), false);
         } else {
             $currencyModel = null;
         }
         if (strlen($value['from']) > 0 && strlen($value['to']) > 0) {
             // -
             $value = sprintf('%s - %s', $currencyModel ? $from : $value['from'], $currencyModel ? $to : $value['to']);
         } elseif (strlen($value['from']) > 0) {
             // and more
             $value = AO::helper('catalogsearch')->__('%s and greater', $currencyModel ? $from : $value['from']);
         } elseif (strlen($value['to']) > 0) {
             // to
             $value = AO::helper('catalogsearch')->__('up to %s', $currencyModel ? $to : $value['to']);
         }
     }
     if (($attribute->getFrontendInput() == 'select' || $attribute->getFrontendInput() == 'multiselect') && is_array($value)) {
         foreach ($value as $k => $v) {
             $value[$k] = $attribute->getSource()->getOptionText($v);
             if (is_array($value[$k])) {
                 $value[$k] = $value[$k]['label'];
             }
         }
         $value = implode(', ', $value);
     } else {
         if ($attribute->getFrontendInput() == 'select' || $attribute->getFrontendInput() == 'multiselect') {
             $value = $attribute->getSource()->getOptionText($value);
             if (is_array($value)) {
                 $value = $value['label'];
             }
         } else {
             if ($attribute->getFrontendInput() == 'boolean') {
                 $value = $value == 1 ? AO::helper('catalogsearch')->__('Yes') : AO::helper('catalogsearch')->__('No');
             }
         }
     }
     $this->_searchCriterias[] = array('name' => $name, 'value' => $value);
     return $this;
 }
开发者ID:ronseigel,项目名称:agent-ohm,代码行数:52,代码来源:Advanced.php


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