On 18-06-2009 at 15:42:14 Igor Sverkos <igor.sverkos+php...@googlemail.com> wrote:

If you don't have an object, just an array - how do I access a simple array key?

With php: modifier you have to use [] for arrays, and . for objects.

<tr tal:condition="exists: data" tal:repeat="item data">
    <td tal:content="item/name" />
    <td tal:content="php: view_Helper_getDate(item.date)" />

The first td-row will work.

The second row will throw a "Trying to get property of non-object..." notice.

Use item['date']

item.date is only for objects, and will not work with arrays.

regards, Kornel

PHPTAL mailing list

Reply via email to