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}}

This doesn't work - but is there an other way to achieve it ?

PHPTAL mailing list

Reply via email to