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


PHP Address::getFormatTypeRenderer方法代码示例

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


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

示例1: getAddressAsString

 /**
  * Represent customer address in 'online' format.
  *
  * @param \Magento\Customer\Api\Data\AddressInterface $address
  * @return string
  */
 public function getAddressAsString(\Magento\Customer\Api\Data\AddressInterface $address)
 {
     $formatTypeRenderer = $this->_addressHelper->getFormatTypeRenderer('oneline');
     $result = '';
     if ($formatTypeRenderer) {
         $result = $formatTypeRenderer->renderArray($this->addressMapper->toFlatArray($address));
     }
     return $this->escapeHtml($result);
 }
开发者ID:pradeep-wagento,项目名称:magento2,代码行数:15,代码来源:Address.php

示例2: getAddressAsHtml

 /**
  * Represent customer address in HTML format.
  *
  * @param \Magento\Customer\Api\Data\AddressInterface $address
  * @return string
  */
 public function getAddressAsHtml(\Magento\Customer\Api\Data\AddressInterface $address)
 {
     $formatTypeRenderer = $this->_customerAddressHelper->getFormatTypeRenderer('html');
     $result = '';
     if ($formatTypeRenderer) {
         $result = $formatTypeRenderer->renderArray($this->addressMapper->toFlatArray($address));
     }
     return $result;
 }
开发者ID:kidaa30,项目名称:magento2-platformsh,代码行数:15,代码来源:Select.php

示例3: getAddressAsString

 /**
  * Represent customer address in 'online' format.
  *
  * @param \Magento\Customer\Service\V1\Data\Address $addressData
  * @return string
  */
 public function getAddressAsString($addressData)
 {
     $formatTypeRenderer = $this->_addressHelper->getFormatTypeRenderer('oneline');
     $result = '';
     if ($formatTypeRenderer) {
         $result = $formatTypeRenderer->renderArray(AddressConverter::toFlatArray($addressData));
     }
     return $this->escapeHtml($result);
 }
开发者ID:zhangjiachao,项目名称:magento2,代码行数:15,代码来源:Address.php

示例4: getBillingAddressHtml

 /**
  * @return string|null
  */
 public function getBillingAddressHtml()
 {
     try {
         $address = $this->_addressService->getAddress($this->getCustomer()->getDefaultBilling());
     } catch (NoSuchEntityException $e) {
         return __('The customer does not have default billing address.');
     }
     return $this->_addressHelper->getFormatTypeRenderer('html')->renderArray(AddressConverter::toFlatArray($address));
 }
开发者ID:aiesh,项目名称:magento2,代码行数:12,代码来源:View.php

示例5: getAddressAsHtml

 /**
  * Represent customer address in HTML format.
  *
  * @param \Magento\Customer\Service\V1\Data\Address $addressData
  * @return string
  */
 public function getAddressAsHtml($addressData)
 {
     $formatTypeRenderer = $this->_customerAddressHelper->getFormatTypeRenderer('html');
     $result = '';
     if ($formatTypeRenderer) {
         $result = $formatTypeRenderer->renderArray(AddressConverter::toFlatArray($addressData));
     }
     return $result;
 }
开发者ID:aiesh,项目名称:magento2,代码行数:15,代码来源:Select.php

示例6: getBillingAddressHtml

 /**
  * Retrieve billing address html
  *
  * @return \Magento\Framework\Phrase|string
  */
 public function getBillingAddressHtml()
 {
     try {
         $address = $this->accountManagement->getDefaultBillingAddress($this->getCustomer()->getId());
     } catch (NoSuchEntityException $e) {
         return __('The customer does not have default billing address.');
     }
     if ($address === null) {
         return __('The customer does not have default billing address.');
     }
     return $this->addressHelper->getFormatTypeRenderer('html')->renderArray($this->addressMapper->toFlatArray($address));
 }
开发者ID:Doability,项目名称:magento2dev,代码行数:17,代码来源:PersonalInfo.php

示例7: format

 /**
  * Format the given address to the given type
  *
  * @param AddressInterface $address
  * @param string $type
  * @return string
  */
 public function format(AddressInterface $address, $type)
 {
     return $this->_addressHelper->getFormatTypeRenderer($type)->renderArray($this->addressMapper->toFlatArray($address));
 }
开发者ID:shabbirvividads,项目名称:magento2,代码行数:11,代码来源:Addresses.php

示例8: testGetFormatTypeRenderer

 /**
  * @param string $code
  * @param \Magento\Customer\Block\Address\Renderer\RendererInterface|null $result
  * @dataProvider getFormatTypeRendererDataProvider
  */
 public function testGetFormatTypeRenderer($code, $result)
 {
     $this->addressConfig->expects($this->once())->method('getFormatByCode')->with($code)->will($this->returnValue(new \Magento\Framework\Object(!is_null($result) ? array('renderer' => $result) : array())));
     $this->assertEquals($result, $this->helper->getFormatTypeRenderer($code));
 }
开发者ID:,项目名称:,代码行数:10,代码来源:

示例9: format

 /**
  * Format the given address to the given type
  *
  * @param Address $address
  * @param string $type
  * @return string
  */
 public function format(Address $address, $type)
 {
     return $this->_addressHelper->getFormatTypeRenderer($type)->renderArray(AddressConverter::toFlatArray($address));
 }
开发者ID:Atlis,项目名称:docker-magento2,代码行数:11,代码来源:Addresses.php


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