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 ) }
{/if} but it give me error. How i can use it.
Who is Participating?
Erdinç Güngör ÇorbacıConnect With a Mentor PHP Development Team LeaderCommented:

{if $access > 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
Erdinç Güngör ÇorbacıPHP Development Team LeaderCommented:
hmm right , you'd better check if it is assigned first

{if isset($access) }
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
Mark BradyPrincipal Data EngineerCommented:
$access = 1;
{if isset($access)}
{echo "Access is set"}
    {echo "Access is NOT set !"}

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