Re: [SMARTY] Weird problem with if-else

"messju mohr" <[email protected]>
Newsgroups gmane.comp.php.smarty.general
Message-ID <20050927130822.GE23872@dune>
On Tue, Sep 27, 2005 at 08:54:56AM -0400, A.J. Brown wrote:
> Problem Solved!
> 
> This is most definitely a bug IMHO. Since my work-around to the problem 
> works, Smarty obviously recognizes the difference in value of true and 
> false without the surrouning quotes.

i tried the code from your original post:
( http://marc.theaimsgroup.com/?l=smarty-general&m=112775309418173&w=2 )
and it works just fine for me (both: with ... eq "true" or ... eq true
(nb: they have slightly different semantics, though)).

it shows absolutely no bug for me. at least not with Smarty-2.6.10,
and that's what you seem to use too, since if you used something
different, than the latest stable, you should obviously have taken
care to mention it.

regards
messju

>  Removing the quotes does not appear 
> to modify the comparison, other than to cause the "unexpected {else}" error.
> 
> Thanks for all of your help!
> 
> Sincerely,
> 
> A.J. Brown
> BitNotion Technologies
> [email protected]
> 
> ----- Original Message ----- 
> From: "pbaker" <[email protected]>
> To: "A.J. Brown" <[email protected]>
> Sent: Tuesday, September 27, 2005 7:09 AM
> Subject: Re: [SMARTY] Weird problem with if-else
> 
> 
> >>{foreach from=$calendar.weeks item="week"}
> >>  <tr class="calendar_week">
> >>   {foreach from=$week item="day"}
> >>   {if $day.blank eq true}
> >>     <td>&nbsp;</td>
> >>   {else}
> >>    {include file="calendar_cell_bit.tpl"}
> >>   {/if}
> >>   {/foreach}
> >>  </tr>
> >>{/foreach}
> >
> >
> >>At first I thought the problem was with the included file, but I still 
> >>get
> >>the error even if I comment out that line.  There are no other {if}
> >>statements anywhere else in this template, so I'm positive it's not a
> >>nesting or unclosed {if} problem.
> >
> >>When I use the following code instead, it works perfectly:
> >
> >>{foreach from=$calendar.weeks item="week"}
> >>  <tr class="calendar_week">
> >>   {foreach from=$week item="day"}
> >>   {if $day.blank eq true}
> >>     <td>&nbsp;</td>
> >>   {/if}
> >>   {if $day.blank eq false}
> >>    {include file="calendar_cell_bit.tpl"}
> >>   {/if}
> >>   {/foreach}
> >>  </tr>
> >>{/foreach}
> >
> >
> >>What's up with this?
> >
> >Hi,
> >the error (i think ;) is in line
> >
> >>   {if $day.blank eq true}
> >
> >
> >try this:
> >
> >>   {if $day.blank eq "true"}
> >
> >it always works for me :P
> >
> >
> >
> >
> 
> -- 
> Smarty General Mailing List (http://smarty.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php

-- 
Smarty General Mailing List (http://smarty.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.