Differences

This shows you the differences between two versions of the page.

improvedtales [2010/12/05 11:36]
123.125.156.206 kZCykuzT
improvedtales [2013/05/24 08:58] (current)
Line 1: Line 1:
-2ivjx3  <a href="http://ovjzvsfqlnng.com/">ovjzvsfqlnng</a>, [url=http://pwgkbjlcjdrj.com/]pwgkbjlcjdrj[/url], [link=http://vjdtmekjsbdt.com/]vjdtmekjsbdt[/link], http://dnzyzixactyz.com/+====== Advanced TALES syntax ====== 
 + 
 +TALES can't handle few cases that happen often and seem quite reasonable to do in templates. 
 + 
 +It can't compare values: 
 + 
 +    <option tal:repeat="opt options" tal:attributes="selected php:opt == selected_option"/
 + 
 +    <title tal:condition="php:count(allimages)==1">Photo</title> 
 +    <title tal:condition="php:count(allimages) GT 1">${php:count(allimages)} photos</title> 
 + 
 +It doesn't have logic expressions: 
 + 
 +    <div tal:condition="php:canShowFoo AND foo.isAvailable()"> 
 + 
 +It can't compute values conditionally: 
 + 
 +    <tr tal:repeat="row rows" tal:attributes="class php:repeat.row.odd ? 'odd' : 'even'"/
 + 
 +It can't pass arguments to functions: 
 + 
 +    <h1 tal:content="php:substr(header, 0,100)"/
 + 
 +    <div tal:content="structure php:getAdvert(PAGE_TOP)"> 
 + 
 + 
 +===== Proposed syntax ===== 
 + 
 +FIXME