本文整理汇总了PHP中Magento\Framework\Data\Form\Element\AbstractElement::getExtType方法的典型用法代码示例。如果您正苦于以下问题:PHP AbstractElement::getExtType方法的具体用法?PHP AbstractElement::getExtType怎么用?PHP AbstractElement::getExtType使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Magento\Framework\Data\Form\Element\AbstractElement
的用法示例。
在下文中一共展示了AbstractElement::getExtType方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: _getAdditionalElementHtml
/**
* Custom additional element html
*
* @param AbstractElement $element
* @return string
*/
protected function _getAdditionalElementHtml($element)
{
// Add name attribute to checkboxes that correspond to multiselect elements
$nameAttributeHtml = $element->getExtType() === 'multiple' ? 'name="' . $element->getId() . '_checkbox"' : '';
$elementId = $element->getId();
$checkboxLabel = __('Change');
$html = <<<HTML
<span class="attribute-change-checkbox">
<label>
<input type="checkbox" {$nameAttributeHtml} onclick="toogleFieldEditMode(this, '{$elementId}')" />
{$checkboxLabel}
</label>
</span>
<script>initDisableFields("{$elementId}")</script>
HTML;
if ($elementId === 'weight') {
$html .= <<<HTML
<script>jQuery(function(\$) {
\$('#weight_and_type_switcher, label[for=weight_and_type_switcher]').hide();
});</script>
HTML;
}
return $html;
}
示例2: _getAdditionalElementHtml
/**
* Custom additional element html
*
* @param AbstractElement $element
* @return string
*/
protected function _getAdditionalElementHtml($element)
{
// Add name attribute to checkboxes that correspond to multiselect elements
$nameAttributeHtml = $element->getExtType() === 'multiple' ? 'name="' . $element->getId() . '_checkbox"' : '';
$elementId = $element->getId();
$dataAttribute = "data-disable='{$elementId}'";
$dataCheckboxName = "toggle_" . "{$elementId}";
$checkboxLabel = __('Change');
$html = <<<HTML
<span class="attribute-change-checkbox">
<input type="checkbox" id="{$dataCheckboxName}" name="{$dataCheckboxName}" class="checkbox" {$nameAttributeHtml} onclick="toogleFieldEditMode(this, '{$elementId}')" {$dataAttribute} />
<label class="label" for="{$dataCheckboxName}">
{$checkboxLabel}
</label>
</span>
HTML;
if ($elementId === 'weight') {
$html .= <<<HTML
<script type="text/javascript">require(["jquery"],function(\$) {
\$('#weight_and_type_switcher, label[for=weight_and_type_switcher]').hide();
});</script>
HTML;
}
return $html;
}
示例3: _getAdditionalElementHtml
/**
* Custom additional element html
*
* @param AbstractElement $element
* @return string
*/
protected function _getAdditionalElementHtml($element)
{
// Add name attribute to checkboxes that correspond to multiselect elements
$nameAttributeHtml = $element->getExtType() === 'multiple' ? 'name="' . $element->getId() . '_checkbox"' : '';
$elementId = $element->getId();
$dataAttribute = "data-disable='{$elementId}'";
$dataCheckboxName = "toggle_" . "{$elementId}";
$checkboxLabel = __('Change');
$html = <<<HTML
<span class="attribute-change-checkbox">
<input type="checkbox" id="{$dataCheckboxName}" name="{$dataCheckboxName}" class="checkbox" {$nameAttributeHtml} onclick="toogleFieldEditMode(this, '{$elementId}')" {$dataAttribute} />
<label class="label" for="{$dataCheckboxName}">
{$checkboxLabel}
</label>
</span>
HTML;
if ($elementId === 'weight') {
$html .= <<<HTML
<script>require(['Magento_Catalog/js/product/weight-handler'], function (weightHandle) {
weightHandle.hideWeightSwitcher();
});</script>
HTML;
}
return $html;
}
示例4: shouldLabelBeAtRight
/**
* 2015-11-24
* @used-by \Df\Backend\Block\Widget\Form\Renderer\Fieldset\Element::shouldLabelBeAtRight()
* @param AE|Element $e
* @return bool
*/
public static function shouldLabelBeAtRight(AE $e)
{
/** @var string|null $position */
$position = $e->getLabelPosition();
return $position ? ElementI::AFTER === $position : in_array($e->getExtType(), ['checkbox', 'radio']);
}