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


PHP AbstractElement::getAfterElementHtml方法代码示例

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


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

示例1: _getElementHtml

 protected function _getElementHtml(\Magento\Framework\Data\Form\Element\AbstractElement $element)
 {
     $html = '';
     if ($element->getBeforeElementHtml() && $element->getBeforeElementHtml() != '') {
         $html .= '<label class="addbefore" for="' . $element->getHtmlId() . '">' . $element->getBeforeElementHtml() . '</label>';
     }
     $html .= '<input id="' . $element->getHtmlId() . '" name="' . $element->getName() . '" ' . ' value="0" type="hidden"/>';
     if ($element->getAfterElementJs() && $element->getAfterElementJs() != '') {
         $html .= $element->getAfterElementJs();
     }
     if ($element->getAfterElementHtml() && $element->getAfterElementHtml() != '') {
         $html .= '<label class="addafter" for="' . $element->getHtmlId() . '">' . $element->getAfterElementHtml() . '</label>';
     }
     return $html;
 }
开发者ID:Doability,项目名称:magento2dev,代码行数:15,代码来源:ActivationFlag.php

示例2: _getElementHtml

 protected function _getElementHtml(\Magento\Framework\Data\Form\Element\AbstractElement $element)
 {
     $html = "<input class=' input-text'  type='hidden' id='" . $element->getHtmlId() . "' name='" . $element->getName() . "' value='" . $element->getEscapedValue() . "' '" . $element->serialize($element->getHtmlAttributes()) . "/>";
     $html .= "<table cellpadding='2' style='width:600px !important;width:auto;' class='wl-cron'>\n            <thead> \n                <tr><th>Days of the week</th><th width='20'></th><th colspan='4'>Hours of the day</th></tr>\n            </thead>\n            <tr>\n                <td width='300' align='left'>\n                    <div>" . $this->checkbox("Monday", "d-Monday", "Monday", 'd') . "</div>\n                    <div>" . $this->checkbox("Tuesday", "d-Tuesday", "Tuesday", 'd') . "</div>\n                    <div>" . $this->checkbox("Wednesday", "d-Wednesday", "Wednesday", 'd') . "</div>\n                    <div>" . $this->checkbox("Thursday", "d-Thursday", "Thurday", 'd') . "</div>\n                    <div>" . $this->checkbox("Friday", "d-Friday", "Friday", 'd') . "</div>\n                    <div>" . $this->checkbox("Saturday", "d-Saturday", "Saturday", 'd') . "</div>\n                    <div>" . $this->checkbox("Sunday", "d-Sunday", "Sunday", 'd') . "</div>\n                </td>\n                <td width='175' class='morning-half'>\n                    <div>" . $this->checkbox("00:00", "h-0000", "00:00 AM", 'h') . "</div>\n                    <div>" . $this->checkbox("01:00", "h-0100", "01:00 AM", 'h') . "</div>\n                    <div>" . $this->checkbox("02:00", "h-0200", "02:00 AM", 'h') . "</div>\n                    <div>" . $this->checkbox("03:00", "h-0300", "03:00 AM", 'h') . "</div>\n                    <div>" . $this->checkbox("04:00", "h-0400", "04:00 AM", 'h') . "</div>\n                    <div>" . $this->checkbox("05:00", "h-0500", "05:00 AM", 'h') . "</div>\n                    <div>" . $this->checkbox("06:00", "h-0600", "06:00 AM", 'h') . "</div>\n                    <div>" . $this->checkbox("07:00", "h-0700", "07:00 AM", 'h') . "</div>\n                    <div>" . $this->checkbox("08:00", "h-0800", "08:00 AM", 'h') . "</div>\n                    <div>" . $this->checkbox("09:00", "h-0900", "09:00 AM", 'h') . "</div>\n                    <div>" . $this->checkbox("10:00", "h-1000", "10:00 AM", 'h') . "</div>\n                    <div>" . $this->checkbox("11:00", "h-1100", "11:00 AM", 'h') . "</div>\n                </td>\n                <td width='175' class='morning'>\n                    <div>" . $this->checkbox("00:30", "h-0030", "00:30 AM", 'h') . "</div>\n                    <div>" . $this->checkbox("01:30", "h-0130", "01:30 AM", 'h') . "</div>\n                    <div>" . $this->checkbox("02:30", "h-0230", "02:30 AM", 'h') . "</div>\n                    <div>" . $this->checkbox("03:30", "h-0330", "03:30 AM", 'h') . "</div>\n                    <div>" . $this->checkbox("04:30", "h-0430", "04:30 AM", 'h') . "</div>\n                    <div>" . $this->checkbox("05:30", "h-0530", "05:30 AM", 'h') . "</div>\n                    <div>" . $this->checkbox("06:30", "h-0630", "06:30 AM", 'h') . "</div>\n                    <div>" . $this->checkbox("07:30", "h-0730", "07:30 AM", 'h') . "</div>\n                    <div>" . $this->checkbox("08:30", "h-0830", "08:30 AM", 'h') . "</div>\n                    <div>" . $this->checkbox("09:30", "h-0930", "09:30 AM", 'h') . "</div>\n                    <div>" . $this->checkbox("10:30", "h-1030", "10:30 AM", 'h') . "</div>\n                    <div>" . $this->checkbox("11:30", "h-1130", "11:30 AM", 'h') . "</div>\n                </td>\n                <td width='175' class='afternoon-half'>\n                    <div>" . $this->checkbox("12:00", "h-1200", "12:00 AM", 'h') . "</div>\n                    <div>" . $this->checkbox("13:00", "h-1300", "01:00 PM", 'h') . "</div>\n                    <div>" . $this->checkbox("14:00", "h-1400", "02:00 PM", 'h') . "</div>\n                    <div>" . $this->checkbox("15:00", "h-1500", "03:00 PM", 'h') . "</div>\n                    <div>" . $this->checkbox("16:00", "h-1600", "04:00 PM", 'h') . "</div>\n                    <div>" . $this->checkbox("17:00", "h-1700", "05:00 PM", 'h') . "</div>\n                    <div>" . $this->checkbox("18:00", "h-1800", "06:00 PM", 'h') . "</div>\n                    <div>" . $this->checkbox("19:00", "h-1900", "07:00 PM", 'h') . "</div>\n                    <div>" . $this->checkbox("20:00", "h-2000", "08:00 PM", 'h') . "</div>\n                    <div>" . $this->checkbox("21:00", "h-2100", "09:00 PM", 'h') . "</div>\n                    <div>" . $this->checkbox("22:00", "h-2200", "10:00 PM", 'h') . "</div>\n                    <div>" . $this->checkbox("23:00", "h-2300", "11:00 PM", 'h') . "</div>\n                </td>\n                <td width='175' class='afternoon'>\n                    <div>" . $this->checkbox("12:30", "h-1230", "12:30 AM", 'h') . "</div>\n                    <div>" . $this->checkbox("13:30", "h-1330", "01:30 PM", 'h') . "</div>\n                    <div>" . $this->checkbox("14:30", "h-1430", "02:30 PM", 'h') . "</div>\n                    <div>" . $this->checkbox("15:30", "h-1530", "03:30 PM", 'h') . "</div>\n                    <div>" . $this->checkbox("16:30", "h-1630", "04:30 PM", 'h') . "</div>\n                    <div>" . $this->checkbox("17:30", "h-1730", "05:30 PM", 'h') . "</div>\n                    <div>" . $this->checkbox("18:30", "h-1830", "06:30 PM", 'h') . "</div>\n                    <div>" . $this->checkbox("19:30", "h-1930", "07:30 PM", 'h') . "</div>\n                    <div>" . $this->checkbox("20:30", "h-2030", "08:30 PM", 'h') . "</div>\n                    <div>" . $this->checkbox("21:30", "h-2130", "09:30 PM", 'h') . "</div>\n                    <div>" . $this->checkbox("22:30", "h-2230", "10:30 PM", 'h') . "</div>\n                    <div>" . $this->checkbox("23:30", "h-2330", "11:30 PM", 'h') . "</div>\n                </td>\n            </tr>\n        </table>";
     $html .= "<script>\nrequire([\n    'jquery',\n    'mage/mage'\n], function (\$) {\n    \$(function () {\n        jQuery(document).ready(function () {\n\n            if (jQuery('#" . $element->getHtmlId() . "').length > 0) {\n\n                if (jQuery('#" . $element->getHtmlId() . "').val() === '') {\n                    jQuery('#" . $element->getHtmlId() . "').val('{\"days\":[],\"hours\":[]}');\n                }\n                var cron = jQuery.parseJSON(jQuery('#" . $element->getHtmlId() . "').val());\n\n                for (var i = 0; i < cron.days.length; i++) {\n                    if (jQuery('#d-' + cron.days[i])) {\n                        jQuery('#d-' + cron.days[i]).prop('checked', true);\n                    }\n                }\n\n                for (var i = 0; i < cron.hours.length; i++) {\n                    if (jQuery('#h-' + cron.hours[i].replace(':', ''))) {\n                        jQuery('#h-' + cron.hours[i].replace(':', '')).prop('checked', true);\n                    }\n                }\n\n                jQuery('.cron-box').on('click', function () {\n                    var d = new Array();\n                    jQuery('.cron-d-box').each(function () {\n                        if (jQuery(this).prop('checked')) {\n                            d.push(jQuery(this).val());\n                        }\n                    });\n                    var h = new Array();\n                    jQuery('.cron-h-box').each(function () {\n                        if (jQuery(this).prop('checked')) {\n                            h.push(jQuery(this).val());\n                        }\n                    });\n                    jQuery('#" . $element->getHtmlId() . "').val(Object.toJSON({days: d, hours: h}));\n                });\n            }\n        });\n    });\n});\n</script>";
     $html .= $element->getAfterElementHtml();
     return $html;
 }
开发者ID:Doability,项目名称:magento2dev,代码行数:8,代码来源:Cron.php

示例3: _getElementHtml

 public function _getElementHtml(\Magento\Framework\Data\Form\Element\AbstractElement $element)
 {
     return $element->getAfterElementHtml();
 }
开发者ID:dragonsword007008,项目名称:magento2,代码行数:4,代码来源:Ajaxvalidate.php


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