本文整理汇总了PHP中Magento\Config\Block\System\Config\Form\Field::render方法的典型用法代码示例。如果您正苦于以下问题:PHP Field::render方法的具体用法?PHP Field::render怎么用?PHP Field::render使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Magento\Config\Block\System\Config\Form\Field
的用法示例。
在下文中一共展示了Field::render方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: render
public function render(AbstractElement $element)
{
$element->unsScope();
$element->unsCanUseWebsiteValue();
$element->unsCanUseDefaultValue();
$element->setValue(__('Update'));
$element->setData('onclick', 'javascript:geoIpUpdate(); return false;');
$element->setData('class', 'action-default');
$element->setData('after_element_js', '<script type="application/javascript">
require(["jquery"], function($){
window.geoIpUpdate = function() {
$.getJSON(
"' . $this->getUrl('tobai_geoip2/database/update') . '",
function(data) {
if (data.status_info) {
$("#row_tobai_geoip2_database_status .value").html(data.status_info);
}
}
);
};
$(document).bind("ajaxSend", function() {
$("body").trigger("processStart");
});
$(document).bind("ajaxComplete", function() {
$("body").trigger("processStop");
});
});
</script>');
return parent::render($element);
}
示例2: render
/**
* @param AbstractElement $element
* @return string
*/
public function render(AbstractElement $element)
{
if (!$element instanceof Select || empty($element->getData('values'))) {
return '';
}
return parent::render($element);
}
示例3: render
/**
* @param \Magento\Framework\Data\Form\Element\AbstractElement $element
* @return string
*/
public function render(\Magento\Framework\Data\Form\Element\AbstractElement $element)
{
if ($this->getRequest()->getParam('website') != '') {
$priceScope = $this->_scopeConfig->getValue(\Magento\Store\Model\Store::XML_PATH_PRICE_SCOPE, \Magento\Store\Model\ScopeInterface::SCOPE_STORE);
if ($priceScope == \Magento\Store\Model\Store::PRICE_SCOPE_GLOBAL) {
return '';
}
}
return parent::render($element);
}
示例4: testRenderInheritCheckbox
public function testRenderInheritCheckbox()
{
$this->_elementMock->expects($this->any())->method('getInherit')->will($this->returnValue(true));
$this->_elementMock->expects($this->any())->method('getCanUseWebsiteValue')->will($this->returnValue(true));
$this->_elementMock->expects($this->any())->method('getCanUseDefaultValue')->will($this->returnValue(true));
$this->_elementMock->expects($this->once())->method('setDisabled')->with(true);
$expected = '<td class="use-default">';
$expected .= '<input id="' . $this->_testData['htmlId'] . '_inherit" name="' . $this->_testData['name'] . '[inherit]" type="checkbox" value="1"' . ' class="checkbox config-inherit" checked="checked"' . ' onclick="toggleValueElements(this, Element.previous(this.parentNode))" /> ';
$expected .= '<label for="' . $this->_testData['htmlId'] . '_inherit" class="inherit">Use Website</label>';
$actual = $this->_object->render($this->_elementMock);
$this->assertContains($expected, $actual);
}
示例5: render
/**
* Render text
*
* @param \Magento\Framework\Data\Form\Element\AbstractElement $element
* @return string
*/
public function render(\Magento\Framework\Data\Form\Element\AbstractElement $element)
{
// $html='<li class="notice-msg">
//
// * <a href="https://docs.mageplaza.com/blog-m2/" target="_blank">User Guide</a> <br>
// * <a href="https://mageplaza.freshdesk.com/support/discussions/topics/new?forum_id=6000241371" target="_blank">Report a problem</a> <br>
// * Your default blog URL <strong>domain.com/blog/</strong> <br>
// * Atom Feed <strong>domain.com/blog/post/rss/</strong> <br>
// * Sitemap <strong>domain.com/sitemap/blog.xml</strong> <br>
//
// </li>';
// return $html;
return parent::render($element);
}
示例6: render
/**
* Render country field considering request parameter
*
* @param \Magento\Framework\Data\Form\Element\AbstractElement $element
* @return string
*/
public function render(\Magento\Framework\Data\Form\Element\AbstractElement $element)
{
$country = $this->getRequest()->getParam(StructurePlugin::REQUEST_PARAM_COUNTRY);
if ($country) {
$element->setValue($country);
}
if ($element->getCanUseDefaultValue()) {
$this->_defaultCountry = $this->_scopeConfig->getValue(self::FIELD_CONFIG_PATH);
if (!$this->_defaultCountry) {
$this->_defaultCountry = $this->directoryHelper->getDefaultCountry();
}
if ($country) {
$shouldInherit = $country == $this->_defaultCountry && $this->getRequest()->getParam(self::REQUEST_PARAM_DEFAULT_COUNTRY);
$element->setInherit($shouldInherit);
}
if ($element->getInherit()) {
$this->_defaultCountry = null;
}
}
return parent::render($element);
}
示例7: render
/**
* {@inheritdoc}
*/
public function render(AbstractElement $element)
{
$element->unsScope()->unsCanUseWebsiteValue()->unsCanUseDefaultValue();
return parent::render($element);
}
示例8: render
/**
* Unset some non-related element parameters
*
* @param \Magento\Framework\Data\Form\Element\AbstractElement $element
* @return string
*/
public function render(\Magento\Framework\Data\Form\Element\AbstractElement $element)
{
$element->unsScope()->unsCanUseWebsiteValue()->unsCanUseDefaultValue();
return parent::render($element);
}
示例9: render
public function render(\Magento\Framework\Data\Form\Element\AbstractElement $element)
{
$element->setDateFormat(\Magento\Framework\Stdlib\DateTime::DATE_INTERNAL_FORMAT);
$element->setTimeFormat(null);
return parent::render($element);
}
示例10: render
/**
* Retrieve HTML markup for given form element
*
* @param \Magento\Framework\Data\Form\Element\AbstractElement $element
* @return string
*/
public function render(\Magento\Framework\Data\Form\Element\AbstractElement $element)
{
$element->setRenderer($this);
return parent::render($element);
}