[Catalyst-dev] Tutorial updates...

Ash Berlin ash_cpan at firemirror.com
Sun May 25 00:16:24 BST 2008


On 24 May 2008, at 20:35, Marcus Ramberg wrote:

>
> On 19. mai. 2008, at 19.08, hkclark at gmail.com wrote:
>
>> Thanks for the input.  There have been a number of discussions  
>> about TTSite vs. straight TT and using the default template vs. $c- 
>> >stash->{template} that I have seen over the past 2 years (and  
>> probably a bunch more that I'm not aware of).
>>
>> Re TTSite, I tend to think it's pretty cool.  Yeah, I like to  
>> customize it, but especially for a tutorial, I think it's nice to  
>> type one helper command and instantly get examples of various  
>> "advanced TT features" (nested templates, central config file,  
>> etc.) vs. having to painfully walk through similar stuff step-by- 
>> step.  I agree that experienced TT folks might want to go with  
>> something different in their next project if TTSite makes a bunch  
>> of assumptions they don't like, but it seems pretty good as a  
>> starting point for a tutorial for me.
>>
>> Does the group have specific things they don't like about TTSite?   
>> If so, should we consider making a new TTSite2 (or whatever name we  
>> want) that doesn't have these limitations?
>
> I personally dislike specially the fact that the TTSite helper ...

> ... changes the context object name to Catalyst,

Dont much see the point in this one.

> ... that it splits up the template into path into src and lib which  
> I find unnecessary and confusing.

src and lib would make sense if the providers were setup right such  
that the top level template only gets searched for in src, and  
PROCESS, INCLUDE etc only looked for under lib. But since this isn't  
the case, agreed, there is little point.

> ... uses wrapper,

I do use a WRAPPER config directive.


> but that might be my personal preference. Another point is that most  
> people in the #catalyst channel don't use TTSite, which makes it  
> harder for newbies to get help there.
>
>> Re default template, I was under the impression that it was better  
>> to explicitly set the template because of situations like $c- 
>> >forward.  I think I have seen other reasons, but I don't recall  
>> them at the moment.  So I added an example of the default template  
>> in the tutorial so people know about it, but made most of it use $c- 
>> >stash->{template}.  I was under the impression that folks like MST  
>> and JRock recommended $c->stash->{template}.  Am I wrong?
>
> As you say, there are currently cases that make it necessary to  
> specify the template explicitly, however it is not very DRY. Once  
> the 'go' branch is merged, those cases go away, and I propose we  
> change to use the default behavior in the tutorial then. (Should  
> happen by the next runtime release).
>

AFAIK recomend practice when setting values in the stash is to do the  
following:

$c->stash(template => 'foo.tt');

and *not*

$c->stash->{template} = 'foo.tt';

-ash




More information about the Catalyst-dev mailing list