[Catalyst] Re: How to access current MyApp instance ?

A. Pagaltzis pagaltzis at gmx.de
Thu Jul 5 16:45:39 GMT 2007


* Perrin Harkins <perrin at elem.com> [2007-07-05 17:30]:
> I never add any variables to the stash from inside my templates
> (temporary loop variables excluded), avoid MACRO (I only use
> PROCESS), and generally keep the templates  very, very simple.

That’s what I was advising, basically, except that I would tell
people to use INCLUDE instead of PROCESS.

Else you’ll be violating your own rule not to add variables to
the stash from inside a template, as soon as any of your blocks
are parametrisable.

> Templates aren't normal code (even with in-line perl) and they
> don't handle complexity like real code does, so you have to
> control your impulse to turn them into thousands of little
> components. It just gets too confusing.

The question is whether this is intrinsic to templates or simply
a consequence of the extensive limitations of the TT language. I
contend that there’s no innate property of templates making them
so different from code of other kinds that they *have* to suffer
these problems.

It just requires that the designer of the templating system
approach it from the very start with the mindset that writing
templates is plain old programming and the lessons of structured
programming apply.

Regards,
-- 
Aristotle Pagaltzis // <http://plasmasturm.org/>



More information about the Catalyst mailing list