1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

PHP callbacks for new pages - special HTML encoding?

Discussion in 'Troubleshooting and Problems' started by Afforess, Jun 25, 2012.

  1. Afforess

    Afforess Member

    I followed this excellent tutorial on how to set up custom pages and write php callbacks to generate dynamic html content, and have that all working splendidly. However, when I use my php callback to return any html code, it is encoded incorrectly.

    For example, if I use the callback to return this:
    $response->params['example_url'] = "<a href="www.example.com>example!</a>";
    On the page, where I use:

    <div id="example">
    I see this:
    <a href="www.example.com>example!</a>
    Instead of this:

    (I am not talking about the BBCode I used to make "example!" a url, I am talking about the fact that is shows the raw html instead of formatting it as a url.)

    And if I take a look at the source, I see this:
    &lt;a href=&quot;www.example.com&gt;example&lt;/a&gt;
    I understand this some kind of html special encoding, but I can't seem to disable or decode it. What am I doing wrong?
  2. Robbo

    Robbo Well-Known Member

    Use {xen:raw $example_url}
    Jake Bunce likes this.
  3. Afforess

    Afforess Member

    Perfect, thanks! Is there a complete list of all the xenforo html codes?
  4. Jake Bunce

    Jake Bunce XenForo Moderator Staff Member

    Akela likes this.

Share This Page