OroPlatform Forums

Covering OroPlatform topics, including community updates and company announcements.

Forums Forums OroPlatform OroPlatform – Programming Questions AddressBundle\Entity\AbstractAddress __toString()

This topic contains 2 replies, has 2 voices, and was last updated by  seddonm1 6 years, 4 months ago.

Starting from March 1, 2020 the forum has been switched to the read-only mode. Please head to StackOverflow for support.

  • Creator
  • #33344


    I have returned to Oro after spending some time with the early betas and it is very much improved.

    I have found a scenario where I would like to be able to call a function similar to the javascript renderAddress version. I have seen you have this ‘todo’ action and was wondering if you have any improvements that are available?


    * Convert address to string
    * @todo: Address format must be used here
    * @return string
    public function __toString()
    $data = array(

    $str = implode(‘ ‘, $data);
    $check = trim(str_replace(‘,’, ”, $str));
    return empty($check) ? ” : $str;

Viewing 2 replies - 1 through 2 (of 2 total)
  • Author
  • #33345
    Yevhen Shyshkin
    Yevhen Shyshkin

    Hello, seddonm1.

    Thank you for notice, we definitely need to improve this behavior.

    For now you can use AddressFormatter::format function to generate localized address format on backend, and twig filter oro_format_address or renderAddress macros in templates.



    Thanks Yevhen.

Viewing 2 replies - 1 through 2 (of 2 total)

The forum ‘OroPlatform – Programming Questions’ is closed to new topics and replies.

You will be redirected to [title]. Would you like to continue?

Yes No