网创优客建站品牌官网
为成都网站建设公司企业提供高品质网站建设
热线:028-86922220
成都专业网站建设公司

定制建站费用3500元

符合中小企业对网站设计、功能常规化式的企业展示型网站建设

成都品牌网站建设

品牌网站建设费用6000元

本套餐主要针对企业品牌型网站、中高端设计、前端互动体验...

成都商城网站建设

商城网站建设费用8000元

商城网站建设因基本功能的需求不同费用上面也有很大的差别...

成都微信网站建设

手机微信网站建站3000元

手机微信网站开发、微信官网、微信商城网站...

建站知识

当前位置:首页 > 建站知识

怎么配置Magento2system.xmldateTime时间

这篇文章主要讲解了“怎么配置Magento2 system.xml dateTime时间”,文中的讲解内容简单清晰,易于学习与理解,下面请大家跟着小编的思路慢慢深入,一起来研究和学习“怎么配置Magento2 system.xml dateTime时间”吧!

10年积累的网站建设、成都网站设计经验,可以快速应对客户对网站的新想法和需求。提供各种问题对应的解决方案。让选择我们的客户得到更好、更有力的网络服务。我虽然不认识你,你也不认识我。但先网站设计后付款的网站建设流程,更有铜鼓免费网站建设让你可以放心的选择与我们合作。

配置:

怎么配置Magento2 system.xml dateTime时间

效果:

怎么配置Magento2 system.xml dateTime时间

DateTime文件内容:

namespace Olight\Presale\Block\Adminhtml\System\Config;
class DateTime extends \Magento\Config\Block\System\Config\Form\Field
{

    protected $timezone;

    public function __construct(
        \Magento\Backend\Block\Template\Context $context,
        \Magento\Framework\Stdlib\DateTime\TimezoneInterface $timezone,
        array $data = []
    ) {
        $this->timezone = $timezone;
        parent::__construct($context, $data);
    }

    public function render(\Magento\Framework\Data\Form\Element\AbstractElement $element)
    {
        $element->setDateFormat($this->timezone->getDateFormat());
        $element->setTimeFormat($this->timezone->getTimeFormat());
        $element->setShowsTime(true);
        return parent::render($element);
    }
}
?>

感谢各位的阅读,以上就是“怎么配置Magento2 system.xml dateTime时间”的内容了,经过本文的学习后,相信大家对怎么配置Magento2 system.xml dateTime时间这一问题有了更深刻的体会,具体使用情况还需要大家实践验证。这里是创新互联,小编将为大家推送更多相关知识点的文章,欢迎关注!


当前文章:怎么配置Magento2system.xmldateTime时间
本文路径:http://bjjierui.cn/article/pjecdc.html

其他资讯