[Catalyst] template design issue: varibales stand-alone components

Alexander Tamm alex at frantic.com
Thu Feb 5 09:11:10 GMT 2009


>> I am used to the idea that I can have a parent template (autohandler in  
>> Mason), which provides basic navigation and status display for the site;  
>> autohandler then invokes another template (a master template for that  
>> particual page's content) which itself uses various odd templates for

Using Mason with Catalyst does not imply that you have to lose your 
autohandlers. Actually, we've found the transition from Mason-only sites 
to Catalyst+Mason sites to work quite smoothly.

> Also, this makes me cringe a bit:
> 
>     Dear Dr.  <% $surname %>!
> 
> I would think you would hide that in an object (or hash if you like as
> TT doesn't care), and do:
> 
>     Dear Dr. [% user.surname %]
> 
> so you don't spend all your coding time populating the stash in your
> controllers.

You're actually comparing apples to oranges here. In your Mason-example 
you've put the surname into the stash, while your TT-example stashes the 
entire object.

If you stash the object, your Mason-example would look like:

     Dear Dr.  <% $user->surname() %>!

which is pure perl, which "user.surname" most decidedly isn't. It's a 
matter of opininon, but I'd rather use perl than something else with a 
learning curve. Haven't tried out TT, so this is just my biased opinion.

Alex



More information about the Catalyst mailing list