[Tickets #1558] NEW: in templates allow to check if array members exist

bugs at bugs.horde.org bugs at bugs.horde.org
Wed Mar 16 01:28:42 PST 2005


DO NOT REPLY TO THIS MESSAGE. THIS EMAIL ADDRESS IS NOT MONITORED.

Ticket URL: http://bugs.horde.org/ticket/?id=1558
-----------------------------------------------------------------------
 Ticket             | 1558
 Created By         | vilius at lnk.lt
 Summary            | in templates allow to check if array members exist
 Queue              | Horde Framework Packages
 State              | New
 Priority           | 1. Low
 Type               | Enhancement
 Owners             | 
-----------------------------------------------------------------------


vilius at lnk.lt (2005-03-16 01:28) wrote:

To better illustrate what I have on my mind I'll show you some code from
Agora.

------- threads.php -----------
/* Set up the template tags. */
$template = &new Horde_Template();
$template->set('threads', $threads_list, true);

------ templates/threads.html ---------
 <loop:threads>
 <tr>
  <td class="<tag:threads.class /> nowrap">
   <tag:threads.link /><tag:threads.message_subject /></a>
   <span class="small">
    [<loop:threads.actions><divider:threads.actions>,
</divider:threads.actions><tag:threads.actions /></loop:threads.actions>]
   </span>
  </td>

You can note, that if threads.actions doesn't exist, you only see [, ] in
generated html code. And we cannot check it with
<if:threads.actions></if:threads.actions> because template engine only can
check top level array members for this, e.g. threads.

Hope that's understandable :)




More information about the bugs mailing list