On Mon, Jan 21, 2008 at 12:43:21PM +0200, Anton Andrievskij wrote:

> I have to fill JavaScript array using PHPTAL attributes.
> Whether I can use some <span ...tal-attributes here..></span> inside
> <script></script> construction?
> Example:
> <script language="JavaScript">
>    items = array(
>        <span ..PHPTAL loop here...>
>            <span tal:replace ...writing item values to fill JavaScript
> array...></span>
>        </span>
>    )
> </script>
> If I can't do so, have you any idea about how to do it?

you can do so. but IE can not cope with trailing ``,``; so you have to
add something like:

 <span tal:condition="not:repeat/item/end">, </span>

and beside that: why not write method, that returns the data directly?
or a phptal_tales_something "formatter"?


Attachment: pgpFbuPWUJM7f.pgp
Description: PGP signature

PHPTAL mailing list

Reply via email to