On 25.01.2009, at 11:53, Szymek Przybył wrote:

I have some problem with chain of strings and php variable in tal:attributes:

<a tal:attributes="class php:ligaInfo['liga']==1?'blank':false;href php:ligaInfo['liga'] GT 1?string:/league/${php:ligaInfo['liga']-1}/ 1:false">

And if ligaInfo['liga'] is greater than 1, this <a> have a href - eg. 'league/1/1' (otherwise - not). PHPTAL gives me an error:
Parse error: syntax error, unexpected '/' in /tmp/tpl_blablablabla....

Where I done a mistake?

You can't mix php: modifier with others (i.e. after php: you have to use PHP syntax for everything).

> php:ligaInfo['liga'] GT 1?string:/league/${php:ligaInfo['liga']-1}/ 1:false

Should be:

php:ligaInfo['liga'] GT 1? '/league/' . (ligaInfo['liga']-1) . '/ 1':false


--
regards, Kornel




_______________________________________________
PHPTAL mailing list
PHPTAL@lists.motion-twin.com
http://lists.motion-twin.com/mailman/listinfo/phptal

Reply via email to