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"?