Adding [% USE dumper; dumper.dump(authors); -%], then it appears:

$VAR1=[];
Authors: ARRAY(0x9ff9278)

With:

[% FOREACH author IN authors %]
<tr><td>
[% author || "No author here" %]
</td></tr>

nothing appears.

Where I solve this problem?

--- Mer 18/8/10, Felipe Gasper (cPanel) <[email protected]> ha scritto:

> Da: Felipe Gasper (cPanel) <[email protected]>
> Oggetto: Re: [Templates] problem with array and FOEARCH
> A: "dark0s" <[email protected]>
> Data: Mercoledì 18 agosto 2010, 18:46
> Try this:
> 
> [% USE dumper; dumper.dump(authors); -%]
> 
> ...to see what exactly TT thinks “authors” is. That
> will probably show 
> you the way.
> 
> My guess is that somehow it’s an empty array.
> 
> -F
> 
> On 8/18/10 11:43 AM, dark0s wrote:
> > I have the following temnplate/HTML code:
> >
> > <table width="100">
> >
> > <tr><td>Authors: [% authors
> %]</td></tr>
> >
> > [% FOREACH author IN authors %]
> > <tr><td>
> >    [% author %]
> > </td></tr>
> > [% END %]
> >
> > </table>
> >
> > The output page is only:
> >
> > Authors: ARRAY(0x95e6278)
> >
> > but it doesn't appear [% author %] variable. Where is
> the problem?
> >
> > Regards,
> > Savio
> >
> >
> >
> >
> >
> > _______________________________________________
> > templates mailing list
> > [email protected]
> > http://mail.template-toolkit.org/mailman/listinfo/templates
> 
> 


      


_______________________________________________
templates mailing list
[email protected]
http://mail.template-toolkit.org/mailman/listinfo/templates

Reply via email to