• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 230
  • Last Modified:

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.
0
umaxim
Asked:
umaxim
3 Solutions
 
Erdinç Güngör ÇorbacıPHP Development Team LeaderCommented:
try

{if $access > 0 }
   tesdsd
{/if}
0
 
Mark BradyCommented:
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
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 
umaximAuthor Commented:
it assigned i checked it already
0
 
Mark BradyCommented:
$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
 
rinirinkuCommented:
something like this-> in php
$smarty->assign('access',1);//declaring a smarty variable

http://www.smarty.net/docs/en/language.basic.syntax.tpl
0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now