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


PHP AbstractElement::getValue方法代码示例

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


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

示例1: _getElementHtml

 /**
  * @param AbstractElement $element
  * @return string
  */
 protected function _getElementHtml(AbstractElement $element)
 {
     $element->setStyle('width:70px;')->setName($element->getName() . '[]');
     if ($element->getValue()) {
         $values = explode(',', $element->getValue());
     } else {
         $values = [];
     }
     $from = $element->setValue(isset($values[0]) ? $values[0] : null)->getElementHtml();
     $to = $element->setValue(isset($values[1]) ? $values[1] : null)->getElementHtml();
     return __('<label class="label"><span>from</span></label>') . $from . __('<label class="label"><span>to</span></label>') . $to;
 }
开发者ID:pradeep-wagento,项目名称:magento2,代码行数:16,代码来源:YearRange.php

示例2: _getElementHtml

 /**
  * @param AbstractElement $element
  * @return string
  * @SuppressWarnings(PHPMD.NPathComplexity)
  */
 protected function _getElementHtml(AbstractElement $element)
 {
     $_options = ['d' => __('Day'), 'm' => __('Month'), 'y' => __('Year')];
     $element->setValues($_options)->setClass('select-date')->setName($element->getName() . '[]');
     if ($element->getValue()) {
         $values = explode(',', $element->getValue());
     } else {
         $values = [];
     }
     $_parts = [];
     $_parts[] = $element->setValue(isset($values[0]) ? $values[0] : null)->getElementHtml();
     $_parts[] = $element->setValue(isset($values[1]) ? $values[1] : null)->getElementHtml();
     $_parts[] = $element->setValue(isset($values[2]) ? $values[2] : null)->getElementHtml();
     return implode(' <span>/</span> ', $_parts);
 }
开发者ID:kidaa30,项目名称:magento2-platformsh,代码行数:20,代码来源:DateFieldsOrder.php

示例3: _getElementHtml

 /**
  * @param AbstractElement $element
  * @return string
  */
 protected function _getElementHtml(AbstractElement $element)
 {
     $extensionVersion = $this->_helper->getExtensionVersion();
     $versionLabel = sprintf('<a href="%s" title="Easy Template Path Hints for Magento 2" target="_blank">%s</a>', self::EXTENSION_URL, $extensionVersion);
     $element->setValue($versionLabel);
     return $element->getValue();
 }
开发者ID:EliasKotlyar,项目名称:magento2-easy-template-path-hints,代码行数:11,代码来源:Version.php

示例4: _getElementHtml

 /**
  * @param AbstractElement $element
  * @return string
  */
 protected function _getElementHtml(AbstractElement $element)
 {
     $extensionVersion = $this->_helper->getExtensionVersion();
     $extensionTitle = 'Custom Shipping';
     $versionLabel = sprintf('<a href="%s" title="%s" target="_blank">%s</a>', self::EXTENSION_URL, $extensionTitle, $extensionVersion);
     $element->setValue($versionLabel);
     return $element->getValue();
 }
开发者ID:MagePsycho,项目名称:magento2-custom-shipping,代码行数:12,代码来源:Version.php

示例5: _getElementHtml

 /**
  * @param AbstractElement $element
  * @return string
  * @SuppressWarnings(PHPMD.NPathComplexity)
  */
 protected function _getElementHtml(AbstractElement $element)
 {
     $_months = [];
     for ($i = 1; $i <= 12; $i++) {
         $_months[$i] = $this->_localeDate->date(mktime(null, null, null, $i))->format('m');
     }
     $_days = [];
     for ($i = 1; $i <= 31; $i++) {
         $_days[$i] = $i < 10 ? '0' . $i : $i;
     }
     if ($element->getValue()) {
         $values = explode(',', $element->getValue());
     } else {
         $values = [];
     }
     $element->setName($element->getName() . '[]');
     $_monthsHtml = $element->setStyle('width:100px;')->setValues($_months)->setValue(isset($values[0]) ? $values[0] : null)->getElementHtml();
     $_daysHtml = $element->setStyle('width:50px;')->setValues($_days)->setValue(isset($values[1]) ? $values[1] : null)->getElementHtml();
     return sprintf('%s %s', $_monthsHtml, $_daysHtml);
 }
开发者ID:kidaa30,项目名称:magento2-platformsh,代码行数:25,代码来源:YtdStart.php

示例6: getInputHtml

 /**
  * Render HTML of the element using the rule engine.
  *
  * @return string
  */
 public function getInputHtml()
 {
     $this->rule->setElementName($this->element->getName());
     if ($this->element->getValue()) {
         /* Hack : reload in a new instance to have element name set.
          *        can not be done in afterLoad of the backend model
          *        since we do not know yet the form structure
          */
         $conditions = $this->element->getValue()->getConditions()->asArray();
         $this->rule->getConditions()->loadArray($conditions);
         $this->element->setRule($this->rule);
     }
     $this->input = $this->elementFactory->create('text');
     $this->input->setRule($this->rule)->setRenderer($this->conditions);
     return $this->input->toHtml();
 }
开发者ID:smile-sa,项目名称:elasticsuite,代码行数:21,代码来源:Conditions.php

示例7: render

 /**
  * Render element
  *
  * @param \Magento\Framework\Data\Form\Element\AbstractElement $element
  * @return string
  *
  * @see RendererInterface::render()
  */
 public function render(\Magento\Framework\Data\Form\Element\AbstractElement $element)
 {
     $element->addClass('element-value-changer');
     $valueName = $element->getValueName();
     if ($valueName === '') {
         $valueName = '...';
     }
     if ($element->getShowAsText()) {
         $html = ' <input type="hidden" class="hidden" id="' . $element->getHtmlId() . '" name="' . $element->getName() . '" value="' . $element->getValue() . '"/> ' . htmlspecialchars($valueName) . '&nbsp;';
     } else {
         $html = ' <span class="rule-param"' . ($element->getParamId() ? ' id="' . $element->getParamId() . '"' : '') . '>' . '<a href="javascript:void(0)" class="label">';
         if ($this->inlineTranslate->isAllowed()) {
             $html .= $this->escapeHtml($valueName);
         } else {
             $html .= $this->escapeHtml($this->filterManager->truncate($valueName, ['length' => 33, 'etc' => '...']));
         }
         $html .= '</a><span class="element"> ' . $element->getElementHtml();
         if ($element->getExplicitApply()) {
             $html .= ' <a href="javascript:void(0)" class="rule-param-apply"><img src="' . $this->getViewFileUrl('images/rule_component_apply.gif') . '" class="v-middle" alt="' . __('Apply') . '" title="' . __('Apply') . '" /></a> ';
         }
         $html .= '</span></span>&nbsp;';
     }
     return $html;
 }
开发者ID:pradeep-wagento,项目名称:magento2,代码行数:32,代码来源:Editable.php

示例8: _getElementHtml

 /**
  * @param AbstractElement $element
  * @return string
  */
 protected function _getElementHtml(AbstractElement $element)
 {
     $element->setValue($this->_cache->load('admin_notifications_lastcheck'));
     $format = $this->_localeDate->getDateTimeFormat(\IntlDateFormatter::MEDIUM);
     return $this->dateTimeFormatter->formatObject($this->_localeDate->date(intval($element->getValue())), $format);
 }
开发者ID:pradeep-wagento,项目名称:magento2,代码行数:10,代码来源:Notification.php

示例9: _getElementHtml

 /**
  * @param AbstractElement $element
  * @return string
  */
 protected function _getElementHtml(AbstractElement $element)
 {
     $element->setValue($this->_cache->load('admin_notifications_lastcheck'));
     $format = $this->_localeDate->getDateTimeFormat(\Magento\Framework\Stdlib\DateTime\TimezoneInterface::FORMAT_TYPE_MEDIUM);
     return $this->_localeDate->date(intval($element->getValue()))->toString($format);
 }
开发者ID:,项目名称:,代码行数:10,代码来源:

示例10: _getElementHtml

 /**
  * @param AbstractElement $element
  * @return string
  * @codeCoverageIgnore
  */
 protected function _getElementHtml(AbstractElement $element)
 {
     return $this->dateTimeFormatter->formatObject($this->_localeDate->date(intval($element->getValue())), $this->_localeDate->getDateTimeFormat(\IntlDateFormatter::MEDIUM));
 }
开发者ID:pradeep-wagento,项目名称:magento2,代码行数:9,代码来源:Datetime.php

示例11: _getElementHtml

 protected function _getElementHtml(\Magento\Framework\Data\Form\Element\AbstractElement $element)
 {
     $element->setValue($this->_cache->load(\Dotdigitalgroup\Email\Helper\Config::CONNECTOR_FEED_LAST_CHECK_TIME));
     $format = $this->_localeDate->getDateTimeFormat(\IntlDateFormatter::MEDIUM);
     return $this->dateTimeFormatter->formatObject($this->_localeDate->date(intval($element->getValue())), $format);
 }
开发者ID:dragonsword007008,项目名称:magento2,代码行数:6,代码来源:Notification.php


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