Smarty template syntax for negative numbers

os: kubuntu 10.04
PhpStorm 1.0
build 95.192

Im now not sure if this is an editor issue or my way of using smarty issue.

with the code:
{if $NUMERIC_VALUE == 1 }
      //do something in here
{/if}

no errors are shown, but if i use a negative value
{if $NUMERIC_VALUE == -1 }
      //do something in here
{/if}

then the editor shows a red mark with the error message: "reference expected"

Im wondering if the error is because the editor is expecting something-somthing_else   10 - 6 = 4.

any ideas?

3 comments
Comment actions Permalink

i can get rid of the error by surrounding it with quotes
{if $NUMERIC_VALUE == '-1' }
      //do something in here
{/if}

The quotes are not needed for the code to function correctly.

0
Comment actions Permalink

Thank you, the bug is fixed. Will appear in comming version.

0

Please sign in to leave a comment.