[jifty-devel] MASON error in tutorial
Edward Funnekotter
efunneko at gmail.com
Fri Aug 4 07:50:47 EDT 2006
Make sure that when you copy and paste mason examples, any lines that start
with '%' have the '%' in the first column of the line. Otherwise, the code
won't be parsed properly.
EdF
On 8/4/06, Malte Ubl <malte.ubl at gmail.com> wrote:
>
> Hey,
>
> I just installed Jifty on MacOS X 10.4 and started doing the tutorial
> application.
>
> Entering posts via the administration interface works, however when I
> copy the code from the tutorial to view the posts I get a mason error.
> I am new to mason (long time template toolkit fan), so it is hard to
> say why this is failing:
>
> Error:
> Global symbol "$post" requires explicit package name at
> /Users/malte/jifty/MyWeblog/share/web/templates/index.html line 10.
> Global symbol "$post" requires explicit package name at
> /Users/malte/jifty/MyWeblog/share/web/templates/index.html line 11.
>
>
> Code:
> <%init>
> my $posts = MyWeblog::Model::PostCollection->new();
> $posts->unlimit();
> </%init>
>
> <&|/_elements/wrapper, title =>
> Jifty->config->framework('ApplicationName') &>
> <dl>
> % while (my $post = $posts->next) {
> <dt><%$post->title%></dt>
> <dd><%$post->body%></dd>
> % }
> </dl>
> </&>
>
> When I try out the AJAX-driven variant I get the same error within the
> page_of_posts fragment.
>
> The whole thing seems to be a scoping problem. When I define $post
> within the init-block at the top the error goes away but $post is
> empty when the method title ist called, so I guess that the my $post
> definition is somehow not visible on the next line.
>
> I'm probably missing something really obvious, but thanks for your
> help and great work anyway!
>
> malte
> _______________________________________________
> jifty-devel mailing list
> jifty-devel at lists.jifty.org
> http://lists.jifty.org/cgi-bin/mailman/listinfo/jifty-devel
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.bestpractical.com/pipermail/jifty-devel/attachments/20060804/11035147/attachment.htm
More information about the jifty-devel
mailing list