Maybe not via a string but being able to pass attributes using an array with the keys being attribute names would be handy.

On 13-Mar-2010, at 4:12, Christina Van Dyke <> wrote:

I know you can assign attributes to a tag by doing this: <div tal:attributes="class string:myclass; id string:myid;">text</div>

What I want to do is pass a variable to the template that contains all the attributes in one string. Example:

$my_attributes = "class string:myclass; id string:myid;";

<div tal:attributes="my_attributes">text</div>

This doesn't work. Anyone know why, or have a workaround?


PHPTAL mailing list

PHPTAL mailing list

Reply via email to