本文整理汇总了PHP中Magento\Framework\Data\Form\Element\AbstractElement类的典型用法代码示例。如果您正苦于以下问题:PHP AbstractElement类的具体用法?PHP AbstractElement怎么用?PHP AbstractElement使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了AbstractElement类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: _getElementHtml
/**
* @codeCoverageIgnore
*/
protected function _getElementHtml(\Magento\Framework\Data\Form\Element\AbstractElement $element)
{
$originalData = $element->getOriginalData();
$label = $originalData['button_label'];
$this->addData(['button_label' => __($label), 'button_url' => $this->getUrl('magewondersmtp/email/test'), 'html_id' => $element->getHtmlId()]);
return $this->_toHtml();
}
开发者ID:magewonder,项目名称:magento2-smtp,代码行数:10,代码来源:SendTestEmail.php
示例2: _getHeaderTitleHtml
/**
* Return header title part of html for payment solution
*
* @param \Magento\Framework\Data\Form\Element\AbstractElement $element
*
* @return string
* @SuppressWarnings(PHPMD.NPathComplexity)
*/
protected function _getHeaderTitleHtml($element)
{
$html = '<div class="config-heading meli" ><div class="heading"><strong id="meli-logo">' . $element->getLegend();
$html .= '</strong></div>';
$html .= '<div class="button-container meli-cards"><button type="button"' . ' class="meli-payment-btn action-configure button' . '" id="' . $element->getHtmlId() . '-head" onclick="Fieldset.toggleCollapse(\'' . $element->getHtmlId() . '\', \'' . $this->getUrl('*/*/state') . '\'); return false;"><span class="state-closed">' . __('Configure') . '</span><span class="state-opened">' . __('Close') . '</span></button></div></div>';
return $html;
}
开发者ID:SummaSolutions,项目名称:cart-magento2,代码行数:15,代码来源:Payment.php
示例3: _getElementHtml
protected function _getElementHtml(\Magento\Framework\Data\Form\Element\AbstractElement $element)
{
$originalData = $element->getOriginalData();
$buttonLabel = !empty($originalData['button_label']) ? $originalData['button_label'] : $this->_saveButtonLabel;
$this->addData(['button_label' => __($buttonLabel), 'html_id' => $element->getHtmlId(), 'ajax_url' => $this->_urlBuilder->getUrl('seo/system_config_robot/save')]);
return $this->_toHtml();
}
开发者ID:mageplaza,项目名称:magento-2-seo-extension,代码行数:7,代码来源:Saverobot.php
示例4: _getElementHtml
/**
* @param AbstractElement $element
* @return string
*/
protected function _getElementHtml(AbstractElement $element)
{
$element->unsScope();
$element->unsCanUseWebsiteValue();
$element->unsCanUseDefaultValue();
return $this->getDbStatus();
}
开发者ID:ytorbyk,项目名称:magento2-geo-ip2,代码行数:11,代码来源:Status.php
示例5: render
/**
* @param AbstractElement $element
* @return string
*/
public function render(AbstractElement $element)
{
if ($element->getRule() && $element->getRule()->getActions()) {
return $element->getRule()->getActions()->asHtmlRecursive();
}
return '';
}
开发者ID:kidaa30,项目名称:magento2-platformsh,代码行数:11,代码来源:Actions.php
示例6: _getElementHtml
protected function _getElementHtml(\Magento\Framework\Data\Form\Element\AbstractElement $element)
{
$element->setValue(0);
$element->setDisabled('disabled');
$element->setValues([['label' => __('Disabled - Coming Soon...'), 'value' => '0']]);
return $element->getElementHtml();
}
开发者ID:Doability,项目名称:magento2dev,代码行数:7,代码来源:Field.php
示例7: _renderScopeLabel
protected function _renderScopeLabel(\Magento\Framework\Data\Form\Element\AbstractElement $element)
{
$html = '<td class="scope-label" style="display:none;">';
$html .= $element->getTooltip();
$html .= '</td>';
return $html;
}
开发者ID:Doability,项目名称:magento2dev,代码行数:7,代码来源:ActivationFlag.php
示例8: _getElementHtml
/**
* {@inheritdoc}
*/
protected function _getElementHtml(AbstractElement $element)
{
$originalData = $element->getOriginalData();
$buttonLabel = $originalData['button_label'];
$this->addData(['button_label' => __($buttonLabel), 'html_id' => $element->getHtmlId(), 'ajax_url' => $this->_urlBuilder->getUrl('searchsphinx/command/' . $this->getAction())]);
return $this->_toHtml();
}
开发者ID:Doability,项目名称:magento2dev,代码行数:10,代码来源:Command.php
示例9: _getElementHtml
protected function _getElementHtml(\Magento\Framework\Data\Form\Element\AbstractElement $element)
{
$originalData = $element->getOriginalData();
$label = $originalData['button_label'];
$this->addData(array('button_label' => __($label), 'button_url' => $this->authorizeRequestUrl(), 'html_id' => $element->getHtmlId()));
return $this->_toHtml();
}
开发者ID:sendpulse,项目名称:mageia,代码行数:7,代码来源:OauthWizard.php
示例10: render
public function render(\Magento\Framework\Data\Form\Element\AbstractElement $element)
{
$element->setData('after_element_html', "<script src='//ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js'></script><script type=\\'text/javascript\\'>");
// Set up additional JavaScript for our validation using jQuery.
$element->setData('after_element_html', "\n\t jQuery.noConflict();\n jQuery(document).ready(function() {\n\t\t\t\tjQuery('#connector_data_mapping_enterprise_data-head').parent().hide();\n });\n </script>");
return parent::_getElementHtml($element);
}
开发者ID:ThomasNegeli,项目名称:dotmailer-magento2-extension,代码行数:7,代码来源:Enterprisevalidator.php
示例11: _getElementHtml
/**
* Get the button and scripts contents
*
* @param \Magento\Framework\Data\Form\Element\AbstractElement $element
* @return string
*/
protected function _getElementHtml(\Magento\Framework\Data\Form\Element\AbstractElement $element)
{
$originalData = $element->getOriginalData();
$buttonLabel = !empty($originalData['button_label']) ? $originalData['button_label'] : $this->_vatButtonLabel;
$this->addData(['button_label' => __($buttonLabel), 'html_id' => $element->getHtmlId()]);
return $this->_toHtml();
}
开发者ID:niransingh,项目名称:magento2,代码行数:13,代码来源:Button.php
示例12: render
/**
* @param AbstractElement $element
* @return string
*/
public function render(AbstractElement $element)
{
if (!$element instanceof Select || empty($element->getData('values'))) {
return '';
}
return parent::render($element);
}
开发者ID:rafaelstz,项目名称:magento2,代码行数:11,代码来源:EmptySelectDecorator.php
示例13: _getHeaderCommentHtml
/**
* Return header comment part of html for fieldset
*
* @param \Magento\Framework\Data\Form\Element\AbstractElement $element
* @return string
*/
protected function _getHeaderCommentHtml($element)
{
$beforeDiv = '<div style="padding:10px;background-color:#fff;border:1px solid #ddd;margin-bottom:7px;">';
$afterDiv = '</div>';
$synch = __('Click here to <a href="%1">Synchronize</a> with ShipperHQ.', $this->getUrl('shipperhq/synchronize/index'));
$element->getComment() ? $comment = $element->getComment() : ($comment = '');
$html = $beforeDiv . '<table>
<tr>
<td style="vertical-align:bottom">
<b>ShipperHQ installed version ' . $this->getModuleVersion() . '</b>
</td>
</tr>
<tr>
<td colspan="3">
<p>' . $comment . '</p>
</td>
</tr>
<tr>
<td colspan="3">
<p>' . $synch . '</p>
</td>
</tr>
</table>' . $afterDiv;
return $html;
}
开发者ID:shipperhq,项目名称:module-shipper,代码行数:31,代码来源:About.php
示例14: _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
示例15: render
/**
* @param AbstractElement $element
* @return string
*/
public function render(AbstractElement $element)
{
$countryId = false;
$isRegionRequired = false;
if ($country = $element->getForm()->getElement('country_id')) {
$countryId = $country->getValue();
$isRegionRequired = $this->_directoryHelper->isRegionRequired($countryId);
}
$html = '<div class="field field-region ' . ($isRegionRequired ? 'required' : '') . '">' . "\n";
$regionCollection = false;
if ($countryId) {
if (!isset(self::$_regionCollections[$countryId])) {
self::$_regionCollections[$countryId] = $this->_countryFactory->create()->setId($countryId)->getLoadedRegionCollection()->toOptionArray();
}
$regionCollection = self::$_regionCollections[$countryId];
}
$regionId = intval($element->getForm()->getElement('region_id')->getValue());
$htmlAttributes = $element->getHtmlAttributes();
foreach ($htmlAttributes as $key => $attribute) {
if ('type' === $attribute) {
unset($htmlAttributes[$key]);
break;
}
}
// Output two elements - for 'region' and for 'region_id'.
// Two elements are needed later upon form post - to properly set data to address model,
// otherwise old value can be left in region_id attribute and saved to DB.
// Depending on country selected either 'region' (input text) or 'region_id' (selectbox) is visible to user
$regionHtmlName = $element->getName();
$regionIdHtmlName = str_replace('region', 'region_id', $regionHtmlName);
$regionHtmlId = $element->getHtmlId();
$regionIdHtmlId = str_replace('region', 'region_id', $regionHtmlId);
if ($isRegionRequired) {
$element->addClass('required-entry');
}
if ($regionCollection && count($regionCollection) > 0) {
$elementClass = $element->getClass();
$html .= '<label class="label" for="' . $regionIdHtmlId . '"><span>' . $element->getLabel() . '</span>' . '</label>';
$html .= '<div class="control">';
$html .= '<select id="' . $regionIdHtmlId . '" name="' . $regionIdHtmlName . '" ' . $element->serialize($htmlAttributes) . '>' . "\n";
foreach ($regionCollection as $region) {
$selected = $regionId == $region['value'] ? ' selected="selected"' : '';
$regionVal = 0 == $region['value'] ? '' : (int) $region['value'];
$html .= '<option value="' . $regionVal . '"' . $selected . '>' . $this->_escaper->escapeHtml(__($region['label'])) . '</option>';
}
$html .= '</select>' . "\n";
$html .= '<input type="hidden" name="' . $regionHtmlName . '" id="' . $regionHtmlId . '" value=""/>';
$html .= '</div>';
$element->setClass($elementClass);
} else {
$html .= '<label class="label" for="' . $regionHtmlId . '"><span>' . $element->getLabel() . '</span></label>';
$html .= '<div class="control">';
$html .= '<input id="' . $regionHtmlId . '" name="' . $regionHtmlName . '" value="' . $element->getEscapedValue() . '" ' . $element->serialize($htmlAttributes) . "/>" . "\n";
$html .= '<input type="hidden" name="' . $regionIdHtmlName . '" id="' . $regionIdHtmlId . '" value=""/>';
$html .= '</div>' . "\n";
}
$html .= '</div>' . "\n";
return $html;
}
开发者ID:aiesh,项目名称:magento2,代码行数:63,代码来源:Region.php
示例16: _getElementHtml
/**
* Get the button and scripts contents.
*
* @param \Magento\Framework\Data\Form\Element\AbstractElement $element
*
* @return string
*/
public function _getElementHtml(\Magento\Framework\Data\Form\Element\AbstractElement $element)
{
$originalData = $element->getOriginalData();
$buttonLabel = !empty($originalData['button_label']) ? $originalData['button_label'] : $this->buttonLabel;
$url = $this->_urlBuilder->getUrl('dotdigitalgroup_email/addressbook/save');
$this->addData(['button_label' => __($buttonLabel), 'html_id' => $element->getHtmlId(), 'ajax_url' => $url]);
return $this->_toHtml();
}
开发者ID:dotmailer,项目名称:dotmailer-magento2-extension,代码行数:15,代码来源:Wishlist.php
示例17: _getInheritCheckboxLabel
/**
* Retrieve label for the inheritance checkbox
*
* @SuppressWarnings(PHPMD.CamelCaseMethodName)
*
* @param \Magento\Framework\Data\Form\Element\AbstractElement $element The form element
*
* @return string
*/
protected function _getInheritCheckboxLabel(\Magento\Framework\Data\Form\Element\AbstractElement $element)
{
$checkboxLabel = __('Use Default');
if ($element->getCanUseContainerValue()) {
$checkboxLabel = __('Use Container');
}
return $checkboxLabel;
}
开发者ID:smile-sa,项目名称:elasticsuite,代码行数:17,代码来源:Field.php
示例18: render
public function render(\Magento\Framework\Data\Form\Element\AbstractElement $element)
{
$id = $element->getHtmlId();
$html = '<tr id="row_' . $id . '">';
$html .= '<td class="label">' . __('Module Version') . '</td><td class="value">' . $this->getModuleVersion() . '</td><td class="scope-label"></td>';
$html .= '</tr>';
return $html;
}
开发者ID:CelebrosLtd,项目名称:M2_AutoComplete,代码行数:8,代码来源:Info.php
示例19: _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
示例20: render
/**
* Render fieldset html
*
* @param \Magento\Framework\Data\Form\Element\AbstractElement $element
* @return string
*/
public function render(\Magento\Framework\Data\Form\Element\AbstractElement $element)
{
$elementOriginalData = $element->getOriginalData();
if (isset($elementOriginalData['help_link'])) {
$this->setHelpLink($elementOriginalData['help_link']);
}
return $this->toHtml();
}
开发者ID:kidaa30,项目名称:magento2-platformsh,代码行数:14,代码来源:Hint.php
注:本文中的Magento\Framework\Data\Form\Element\AbstractElement类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论