2010/10/4 Kornel Lesiński <kor...@aardvarkmedia.co.uk>

>
> On 2 Oct 2010, at 07:15, romtek wrote:
>
> > Hi,
> >
> > I sometimes need to use multiple values for the class attribute but can't
> seem to find a way to do this in PHPTAL if those values are to be determined
> at run-time. For example,
> >
> > <tr tal:attributes="class php:item.isParent() ? 'parent' : null">...</tr>
> > I also need to set an additional class value, say:
> > "class php:item.is_inactive ? 'inactive' : null"
> >
> > Would somebody please suggest a way to do this?
>
> If you don't mind getting class=" " sometimes (harmless in HTML), then you
> can simply use:
>
> <tr class="${php:…} ${php:…}">
>

I don't mind that at all. This works. Thank you very much! I don't need to
resort to an unpleasant hack anymore.

However, that it works has surprised me as I've never used php: tale inside
${}. I think it's worth mentioning this in the manual.
_______________________________________________
PHPTAL mailing list
PHPTAL@lists.motion-twin.com
http://lists.motion-twin.com/mailman/listinfo/phptal

Reply via email to