Please upgrade here. These earlier versions are no longer being updated and have security issues.
HackerOne users: Testing against this community violates our program's Terms of Service and will result in your bounty being denied.

PHP Code In Menu Is Showing As Text

I am really not sure why this is happening, or how to debug it, but I am trying to show karma balance in menu header and it's showing PHP code instead of the karma balance.

See this:

What's causing it?

Comments

  • well someone attempted to comment something out, which is not in my code at all

    grep is your friend.

  • okhawajaokhawaja New
    edited June 2016

    @x00 said:
    well someone attempted to comment something out, which is not in my code at all

    I am not even sure where that "comment out" part is coming from. All I did was take your code that displayed karma balance and paste it inside the

    tags of menu header to display the balance in menu header.

    The comment out is coming from somewhere :scream:

  • You can't paste php in a smarty template and expect it to work. Also you can't necessarily lift code like that and expect it to work.

    grep is your friend.

  • At the very least, to get php to work in a smarty template you would need to enclose it in

    <literal> </literal>
    

    tags, but as x00 points out, you may still not get what you are hoping for, if the php code is dependent on other parts of the php file you have snipped it from.

  • literal just renders a string, it doesn't run php. The whole point of smarty is separation of conserns.

    grep is your friend.

Sign In or Register to comment.