smarty错误:模板中的语法错误

i have a session which is set thrugh php but when i try to get data using smarty i get following error

Error: Syntax Error in template "d:\server\theme\menu_inc.tpl" on line 10 "{if $smarty.session.user-permissions-ses.t_mgt == 1}" - Unexpected "."

smarty template code.

{if $smarty.session.user-permissions-ses.t_mgt == 1}
    information here
{/if}

I can't seem to know what might be causing this error.

The problem is the hyphens, neither PHP nor smarty like to allow them in variables.

This should make it work though:

{if $smarty.session.{"user-permissions-ses"}.t_mgt == 1}
    information here
{/if}

Here is a thread on the Smarty forums with a little more information.