Smarty Forum Index Smarty
WARNING: All discussion is moving to https://reddit.com/r/smarty, please go there! This forum will be closing soon.

Missing closing bracket@if function@example 7-16

 
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    Smarty Forum Index -> Documentation
View previous topic :: View next topic  
Author Message
vain
Smarty Rookie


Joined: 20 May 2006
Posts: 23
Location: Berlin / Germany

PostPosted: Sun Aug 03, 2008 8:53 pm    Post subject: Missing closing bracket@if function@example 7-16 Reply with quote

http://www.smarty.net/manual/en/language.function.if.php

Quote:

Example 7-16. {if} with more examples

{if isset($name) && $name == 'Blog'}
{* do something *}
{elseif $name == $foo}
{* do something *}
{/if}

{if isset($foo) && is_array($foo) && count($foo) > 0)}
{* do a foreach loop *}
{/if}


Maybe this could be added as another example:

Quote:

{if isset($article_comments) && is_array($article_comments) && count($article_comments) > 0}
Comments
{elseif isset($news_comments)}
1 Comment
{else}
No Comments.
{/if}


Thanks & best regards, vain
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    Smarty Forum Index -> Documentation All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group
Protected by Anti-Spam ACP