Posted by Dc on 10/04/69 11:15
you are mixing smarty and javascript syntax!
server side:
{if $imgArr}
<img src=... /> <!-- html code -->
{/if}
also your comments will cause things to choke:
{* this is a smarty comment *}
<!-- html -->
/* javascript */
if you want to do something client side, you will need to escape the
javascript when the smarty processes it. this is probably the error you
are getting, but solving it wont solve your problem (use the method above).
{literal}
if ( imgArr != "" ){
// js stuff
}
{/literal}
(or put the js in a separate .js file)
bon chance!
/dc
On Sun, 08 May 2005 12:19:31 +0900, Reynier Perez Mira
<rperezm@estudiantes.uci.cu> wrote:
> Hi list:
>
> I try to view if a var declared as array contain value or came empty in
> a .tpl file. I try this:
>
> if ($imgArr neq ""){
>
> // actions
>
> }else{
>
> // others actions
>
> }
>
> But this generate a error. Some help with this ?
>
>
> Reynier Pérez Mira
>
> 3ero. Ing. Informática
>
> Entre más inteligente me siento, más me doy cuenta de lo ignorante que
> soy.
>
>
[Back to original message]
|