本文整理匯總了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));
}