php smarty

Hi i have a question i just begin to study smarty template system and i can not understand how i can use if statement i try to use
{if ( $access > 0 ) }
   tesdsd
{/if} but it give me error. How i can use it.
LVL 1
umaximAsked:
Who is Participating?
 
Erdinç Güngör ÇorbacıConnect With a Mentor PHP Development Team LeaderCommented:
try

{if $access > 0 }
   tesdsd
{/if}
0
 
Mark BradyConnect With a Mentor Principal Data EngineerCommented:
Where have you defined $access ? If you have not defined it, this could cause the error
0
 
Erdinç Güngör ÇorbacıPHP Development Team LeaderCommented:
hmm right , you'd better check if it is assigned first

{if isset($access) }
0
Cloud Class® Course: CompTIA Healthcare IT Tech

This course will help prep you to earn the CompTIA Healthcare IT Technician certification showing that you have the knowledge and skills needed to succeed in installing, managing, and troubleshooting IT systems in medical and clinical settings.

 
umaximAuthor Commented:
it assigned i checked it already
0
 
Mark BradyPrincipal Data EngineerCommented:
$access = 1;
{if isset($access)}
{echo "Access is set"}
{else}
    {echo "Access is NOT set !"}
{/if}


That should work. If you are getting errors post your whole code.
0
 
rinirinkuConnect With a Mentor Commented:
something like this-> in php
$smarty->assign('access',1);//declaring a smarty variable

http://www.smarty.net/docs/en/language.basic.syntax.tpl
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.