Skip Menu |

This queue is for tickets about the Catalyst-Manual CPAN distribution.

Report information
The Basics
Id: 41304
Status: resolved
Priority: 0/
Queue: Catalyst-Manual

People
Owner: Nobody in particular
Requestors: jarich [...] perltraining.com.au
Cc:
AdminCc:

Bug Information
Severity: Important
Broken in: 5.700704
Fixed in: 5.7015



Subject: Wrong name for catalyst context object used in examples
I realise that C<c> is the usual name for the Catalyst context object in template examples, but the use of TTSite for the tutorial means that someone cutting and pasting these examples will have templates that don't completely work for no obvious reason. Version 5.701003 had a huge tip in CatalystBasics at the TTSite creation section that said: "TIP: Note that TTSite does one thing that could confuse people who are used to the normal TT Catalyst view: it redefines the Catalyst context object in templates from its usual c to Catalyst. When looking at other Catalyst examples, remember that they almost always use c. Note that Catalyst and TT do not complain when you use the wrong name to access the context object...TT simply outputs blanks for that bogus logic (see next tip to change this behavior with TT DEBUG options). Finally, be aware that this change in name only applies to how the context object is accessed inside your TT templates; your controllers will continue to use $c (or whatever name you use when fetching the reference from @_ inside your methods). (You can change back to the "default" behavior be removing the CATALYST_VAR line from lib/MyApp/View/TT.pm, but you will also have to edit root/lib/config/main and root/lib/config/url. If you do this, be careful not to have a collision between your own c variable and the Catalyst c variable.)" but the closest that the current Tutorial comes to this is to say in BasicCRUD: "IMPORTANT NOTE As mentioned earlier, the MyApp::View::TT.pm view class created by TTSite redefines the name used to access the Catalyst context object in TT templates from the usual c to Catalyst." It's not mentioned earlier, that I can find; and when I was having troubles with c not working this tip wasn't placed where I was looking. Perhaps - since this tutorial will be more often used by people learning Catalyst than otherwise - you could just make all of the template examples use "Catalyst" instead of "c"?
Subject: Re: [rt.cpan.org #41304] Wrong name for catalyst context object used in examples
Date: Sat, 6 Dec 2008 17:25:47 +0000
To: "jarich [...] perltraining.com.au via RT" <bug-Catalyst-Manual [...] rt.cpan.org>
From: Matt S Trout <mst [...] shadowcat.co.uk>
On Sat, Nov 29, 2008 at 07:03:19AM -0500, jarich@perltraining.com.au via RT wrote: Show quoted text
> Sat Nov 29 07:03:15 2008: Request 41304 was acted upon. > Transaction: Ticket created by jarich@perltraining.com.au > Queue: Catalyst-Manual > Subject: Wrong name for catalyst context object used in examples > Broken in: 5.700704 > Severity: Important > Owner: Nobody > Requestors: jarich@perltraining.com.au > Status: new > Ticket <URL: http://rt.cpan.org/Ticket/Display.html?id=41304 > > > > I realise that C<c> is the usual name for the Catalyst context object in > template examples, but the use of TTSite for the tutorial means that > someone cutting and pasting these examples will have templates that > don't completely work for no obvious reason.
Show quoted text
> Perhaps - since this tutorial will be more often used by people learning > Catalyst than otherwise - you could just make all of the template > examples use "Catalyst" instead of "c"?
No, because the latest TTSite doesn't set CATALYST_VAR. So the current manual is correct if you have the current View::TT. -- Matt S Trout Need help with your Catalyst or DBIx::Class project? Technical Director http://www.shadowcat.co.uk/catalyst/ Shadowcat Systems Ltd. Want a managed development or deployment platform? http://chainsawblues.vox.com/ http://www.shadowcat.co.uk/servers/