本文整理汇总了PHP中Magento\Customer\Helper\Address::getRenderer方法的典型用法代码示例。如果您正苦于以下问题:PHP Address::getRenderer方法的具体用法?PHP Address::getRenderer怎么用?PHP Address::getRenderer使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Magento\Customer\Helper\Address
的用法示例。
在下文中一共展示了Address::getRenderer方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: _getDefaultFormat
/**
* Retrieve default address format
*
* @return \Magento\Framework\Object
*/
protected function _getDefaultFormat()
{
$store = $this->getStore();
$storeId = $store->getId();
if (!isset($this->_defaultTypes[$storeId])) {
$this->_defaultTypes[$storeId] = new \Magento\Framework\Object();
$this->_defaultTypes[$storeId]->setCode('default')->setDefaultFormat('{{depend prefix}}{{var prefix}} {{/depend}}{{var firstname}} {{depend middlename}}' . '{{var middlename}} {{/depend}}{{var lastname}}{{depend suffix}} {{var suffix}}{{/depend}}, ' . '{{var street}}, {{var city}}, {{var region}} {{var postcode}}, {{var country}}');
$this->_defaultTypes[$storeId]->setRenderer($this->_addressHelper->getRenderer(self::DEFAULT_ADDRESS_RENDERER)->setType($this->_defaultTypes[$storeId]));
}
return $this->_defaultTypes[$storeId];
}
示例2: testGetRenderer
/**
* @dataProvider getRendererDataProvider
*/
public function testGetRenderer($renderer, $blockFactory, $result)
{
$this->helper = new \Magento\Customer\Helper\Address($this->context, $blockFactory, $this->storeManager, $this->scopeConfig, $this->customerMetadataService, $this->addressMetadataService, $this->addressConfig);
$this->assertEquals($result, $this->helper->getRenderer($renderer));
}