You are here: Re: [SMARTY] Arrays how to « Smarty Templates Posts « IT news, forums, messages
Re: [SMARTY] Arrays how to

Posted by Dc on 10/18/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.
>
>

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация