Re: [SMARTY] Arrays how to

From: Date: Sun, 08 May 2005 05:44:29 +0000
Subject: Re: [SMARTY] Arrays how to
References: 1  Groups: php.smarty.general 
Request: Send a blank email to php-smarty-general+get-12593@lists.php.net to get a copy of this message
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.


« previous php.smarty.general (#12593) next »