I have set an array to my PHPTal:

$phptal->person = array('first_name'=>'John', 'last_name'=>'Doe');

Works fine to retrieve those values in my template


However, how can I use that in tal:condition?

<div tal:condition="php: person[first_name] eq 'John'"> blah blah</div>
throws an error.

I know that for objects I need to use person.first_name, but what about arrays?

<div tal:condition="php: person/first_name eq 'John'"> blah blah</div>
does not work either...

(how come this kind of basic information is not in the manual? Even the fact that a variable is just ${varname} is not in the basic example...)

PHPTAL mailing list

Reply via email to