Is it possible to use variable variables in PHPTal ?
eg I have a PHP array
$phptal->fieldnames = array(array('key'=>'first_name',
'description'=>'First Name'), array('key'=>'address',
'description=>'Address');
and an object
$person= new stdClass();
$person->first_name = 'Joe';
$person->address='His_street 1';
$phptal->person = $person;
and in my template I'd like to use the "key" of "fieldnames" in a repeat
...
<div tal:repeat="field fieldnames">
${field/description}: ${person/${field/key}}
</div>
This doesn't work - but is there an other way to achieve it ?
_______________________________________________
PHPTAL mailing list
[email protected]
http://lists.motion-twin.com/mailman/listinfo/phptal