[PHPTAL] tal:content with php:
James McLean
james.mclean at gmail.com
Thu May 3 06:47:30 CEST 2007
Howdy,
Using a PHP tales expression to generate a dropdown list, however
every time it executes its returning incorrectly.
The PHPTal is:
<select name="product[discounted]">
<span tal:omit-tag="" tal:condition="exists: productdetail/productdiscounted">
<option value="0"
selected="selected"
tal:attributes="value productdetail/productdiscounted"
tal:content="php: (productdetail.productdiscounted eq '1') ? 'Yes' : 'No' "
></option>
<option>----</option>
</span>
<option value="0">No</option>
<option value="1">Yes</option>
</select>
Regardless of what the value of 'productdetail.productdiscounted' is,
it always prints 'No' in the drop down.
productdetail.productdiscounted will return '0' if the product is not
discounted, and '1' if the product is discounted.
Am I doing something obviously incorrect here?
Cheers
More information about the PHPTAL
mailing list