Re: [PHPTAL] PHPTAL 1.2.0 alpha - is this a bug or my fail?!
Billiant! All fixed :) Think I went a bit slot-crazy ;) Cheers, -Alister 2009/5/15 Kornel Lesiński > It seems that you've used slots where macros would have been more > appropriate. > > > This just defines the same slot many times: > > > > > > > and the code below it, outside the loop: > > > > > > > is run unconditionally, once, after the loop finishes. That's why you're > getting error about entry variable. > > > Change these to: > > > > and > > > > -- > regards, Kornel > > ___ > PHPTAL mailing list > PHPTAL@lists.motion-twin.com > http://lists.motion-twin.com/mailman/listinfo/phptal > -- Alister Cameron Managing Director Cameron Creative Pty Ltd www.cameroncreative.com Creative, Strategic, Innovative... never boring! ___ PHPTAL mailing list PHPTAL@lists.motion-twin.com http://lists.motion-twin.com/mailman/listinfo/phptal
Re: [PHPTAL] PHPTAL 1.2.0 alpha - is this a bug or my fail?!
It seems that you've used slots where macros would have been more appropriate. This just defines the same slot many times: and the code below it, outside the loop: is run unconditionally, once, after the loop finishes. That's why you're getting error about entry variable. Change these to: and -- regards, Kornel ___ PHPTAL mailing list PHPTAL@lists.motion-twin.com http://lists.motion-twin.com/mailman/listinfo/phptal
Re: [PHPTAL] PHPTAL 1.2.0 alpha - is this a bug or my fail?!
Thanks Werner and Kornel... I'll fix the omit-tag thing. A silly oversight. Now, I've uploaded the raw and unprocessed template file to: http://www.alistercameron.com/tal.tpl.txt To clarify, this is a file that is compiled in a rather complex way which has to do with how my WordPress theme is built... I'd rather not try to explain. However it's clear that if a person was going to built that file up manually, they'd do it in a different order of slots, better organized, etc. As long as the content is all there, I trust it's fine. Correct me if I'm wrong. As for the data, it's just nested arrays. In the case of these "entries", the PHP there looks something like: $html_data["entries"]["item-$id"][$fn] = $out; And later executed like so: $phptal = new PHPTAL(); $phptal->setSource($html_source, $file); foreach ($html_data as $k=>$v) { $phptal->$k = $v; } echo $phptal->execute(); Hence what you see in the var_dump... Does that all help at all? Cheers, -Alister PS... one thought... does that foreach above fail if I nest my arrays deeper than just one level (as I have done)? Should it be recursive?? 2009/5/14 Kornel Lesiński > On 14-05-2009 at 06:34:11 Alister Cameron < > alister.came...@cameroncreative.com> wrote: > > > Could I bother someone to have a look at the processed cache file and > > diagnose? > > > > http://www.alistercameron.com/tal.src.txt > > This code uses entry variable _after_ the loop (e.g. in > id="post-${entry/the_ID}"). Do you have such code in your template, or is it > miscompiled? Could you send the source? > > > BTW: you have lots of divs with omit-tag="". It should be tal:omit-tag="". > You can also use . > > > -- > regards, Kornel > > ___ > PHPTAL mailing list > PHPTAL@lists.motion-twin.com > http://lists.motion-twin.com/mailman/listinfo/phptal > -- Alister Cameron Managing Director Cameron Creative Pty Ltd www.cameroncreative.com Creative, Strategic, Innovative... never boring! ___ PHPTAL mailing list PHPTAL@lists.motion-twin.com http://lists.motion-twin.com/mailman/listinfo/phptal
Re: [PHPTAL] PHPTAL 1.2.0 alpha - is this a bug or my fail?!
On 14-05-2009 at 06:34:11 Alister Cameron wrote: > Could I bother someone to have a look at the processed cache file and > diagnose? > > http://www.alistercameron.com/tal.src.txt This code uses entry variable _after_ the loop (e.g. in id="post-${entry/the_ID}"). Do you have such code in your template, or is it miscompiled? Could you send the source? BTW: you have lots of divs with omit-tag="". It should be tal:omit-tag="". You can also use . -- regards, Kornel ___ PHPTAL mailing list PHPTAL@lists.motion-twin.com http://lists.motion-twin.com/mailman/listinfo/phptal
Re: [PHPTAL] PHPTAL 1.2.0 alpha - is this a bug or my fail?!
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: ...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: 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: 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 Fax 03 8610 0050 Click here to find me online: http://clicktoadd.me/alicam ___ PHPTAL mailing list PHPTAL@lists.motion-twin.com http://lists.motion-twin.com/mailman/listinfo/phptal ___ PHPTAL mailing list PHPTAL@lists.motion-twin.com http://lists.motion-twin.com/mailman/listinfo/phptal
[PHPTAL] PHPTAL 1.2.0 alpha - is this a bug or my fail?!
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: 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 Fax 03 8610 0050 Click here to find me online: http://clicktoadd.me/alicam ___ PHPTAL mailing list PHPTAL@lists.motion-twin.com http://lists.motion-twin.com/mailman/listinfo/phptal