[PHPTAL] PHPTAL 1.2.0 alpha - is this a bug or my fail?!
Werner
lists at mollentze.co.za
Thu May 14 08:56:16 CEST 2009
Hi Alister
Can you please post the code that assigns the variables to the template
object?
E.g, If you did the var_dump on $data and $data['entries'] is defined,
and you assigned $data to $template like
$template->data = $data;
...then I would expect the loop to look like:
<span tal:repeat="entry data/entries" omit-tag="">
...Or did you assign it directly like:
$template->entries = $data['entries'];
As a sidenote, you can make use of the tal:block element if you don't
want to output the tag:
<tal:block tal:repeat="entry entries">
<span metal:define-slot="cfct_excerpt" />
</tal:block>
Kind Regards,
Werner
Alister Cameron wrote:
> Gents,
>
> Perhaps I should stick to the production version but I hoped to help
> test the latest alpha.
>
> I've encountered an issue where it's not iterating thru a repeat, but
> I don't see what I'm doing wrong.
>
> Could I bother someone to have a look at the processed cache file and
> diagnose?
>
> http://www.alistercameron.com/tal.src.txt
>
> The TPL file is pretty simple:
>
> <div metal:fill-slot="cfct_loop" omit-tag="">
>
> <span tal:repeat="entry entries" omit-tag="">
> <span metal:define-slot="cfct_excerpt" />
> </span>
>
> </div>
>
> You can see the loop there but the persistent error -- even when I
> comment out that entire wrapping span tag -- is:
>
> Unable to find variable 'entry' in current scope
>
> I don't get it.
>
> The var_dump of the data is here:
>
> http://www.alistercameron.com/tal.data.txt
>
> As far as I can tell it's fine... there's an array called "entries"
> and so forth... don't get the issue.
>
> Cheers,
>
> -Alister
>
> ---
> Alister Cameron // Blogologist
> http://www.alistercameron.com
>
> Mob. 04 0404 5555
> Fax 03 8610 0050
>
> Click here to find me online:
> http://clicktoadd.me/alicam
> ------------------------------------------------------------------------
>
> _______________________________________________
> PHPTAL mailing list
> PHPTAL at lists.motion-twin.com
> http://lists.motion-twin.com/mailman/listinfo/phptal
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.motion-twin.com/pipermail/phptal/attachments/20090514/66f60cda/attachment.htm
More information about the PHPTAL
mailing list