5
<h3><?php echo $this->__('Details & Documents') ?></h3>

The above prints out as: Details &amp; Documents

What is the proper syntax so that it prints as: Details & Documents?

Thanks

7
  • This prints fine for me... are you changing & in the method $this->__();?
    – Will
    Dec 22, 2011 at 17:53
  • 1
    Based on the <h3>-tag, Details &amp; Documents is the correct output from the function. You're not allowed to have stray ampersands in HTML (or XML, for that matter); that's why &amp; is used instead. Dec 22, 2011 at 17:54
  • 1
    Details &amp; Documents is correct.
    – SLaks
    Dec 22, 2011 at 18:10
  • @MichaelMadsen &amp; prints as &amp; unfortunately. Dec 22, 2011 at 18:29
  • 1
    @vulgarbulgar: Details & Documents is invalid HTML.
    – SLaks
    Dec 22, 2011 at 18:31

1 Answer 1

5

html_entity_decode should do what you want:

<h3><?php echo html_entity_decode($this->__('Details & Documents')) ?></h3>

Although there may be a Magento-specific setting for this.

3
  • 1
    Same, pritns as Details &amp; Documents Dec 22, 2011 at 18:28
  • I noticed that before Tim Cooper had edited your post, there was a space after &, so it looked like this: & amp;. Was that a typo, or does your output actually look like that?
    – Bojangles
    Dec 23, 2011 at 0:20
  • That was on purpose, because, for whatever reason, whenever I entered without the space, the post here on this website would print as an '&', instead of &amp; Dec 23, 2011 at 17:43

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.